Documentation
¶
Overview ¶
Package coordination adapts the shared Redis primitives in internal/infra/coordination to the server's own interfaces: the stream hub the SSE handler reads, the event bus the connection registry broadcasts through, and the turn locker the turn queue holds. It is the server-side half of docs/design/server-coordination.md; the infra half stays free of server types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
EventBus is the Redis-backed connection-event fan-out. PublishEvent sends a broadcast to every replica; Incoming carries the broadcasts this replica must deliver to its own connections.
func NewEventBus ¶
NewEventBus subscribes to the shared events channel for the server's lifetime.
func (*EventBus) PublishEvent ¶
type StreamHub ¶
type StreamHub struct {
// contains filtered or unexported fields
}
StreamHub is the Redis-backed websocket.StreamHub.
func NewStreamHub ¶
NewStreamHub returns a stream hub bound to the server's lifetime ctx.
type TurnLocker ¶
type TurnLocker struct {
// contains filtered or unexported fields
}
TurnLocker is the Redis-backed turnqueue.Locker.
func NewTurnLocker ¶
func NewTurnLocker(backend *infra.Backend) *TurnLocker
NewTurnLocker returns a locker over the coordination backend.