anonpenguin23 604ce221d5 feat(gateway): implement persistent webhooks and namespace sequencing
- Add migrations for per-namespace publish sequences and persistent WebSocket function settings
- Integrate PersistentWSManager and WSBridge into the gateway dependency graph
- Upgrade serverless engine to use a multi-tier rate limiter
- Update JWT claims to support custom application-defined fields
2026-05-04 11:38:19 +03:00

22 lines
974 B
Go

// Package persistent implements long-lived per-WebSocket WASM function
// instances. A persistent function is bound to one WS connection for its
// entire lifetime — its WASM module is instantiated once at upgrade,
// retains memory across frames, and is torn down on disconnect.
//
// See plan: core/plans/platform/06_PERSISTENT_WS_FUNCTIONS.md
//
// ABI: persistent functions export three WASM functions instead of using
// the default _start:
//
// ws_open(payloadPtr, payloadLen) → uint32 // 0 = accept, 1 = reject
// ws_frame(payloadPtr, payloadLen) → uint32 // 0 = ok, 1 = close
// ws_close(reasonPtr, reasonLen) → void
//
// The host calls each export at the appropriate lifecycle point. Frames
// are processed serially per connection — wazero instances are NOT
// goroutine-safe.
//
// Replies use the existing ws_send / ws_broadcast host functions; the
// function caches its own client_id (passed in ws_open) for outbound writes.
package persistent