Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RoomFactory ¶
RoomFactory creates Room grains for the cluster grain registry.
Types ¶
type Member ¶
type Member struct {
// contains filtered or unexported fields
}
Member owns a single websocket connection and bridges it to cluster messaging.
func NewMember ¶
func NewMember(conn net.Conn, opts MemberOptions) *Member
NewMember creates a Member actor bound to a websocket connection. The given conn is wrapped so concurrent writes (from readPump's control-frame handling and writePump) are serialized and safe.
func (*Member) Receive ¶
func (m *Member) Receive(ctx *goakt.ReceiveContext)
Receive handles actor messages, including room membership and pubsub fan-in.
type MemberOptions ¶
type MemberOptions struct {
SendQueueSize int
MaxMessageSize int // max inbound message size in bytes; 0 = legacy 1 GiB
RoomDeactivateAfter time.Duration
ResumeSession *store.Session
ReplayLimit int
OnStop func()
NamespacePolicy namespace.Policy // optional namespace access control
}
MemberOptions configures buffer sizes and room lifecycle behavior.
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
Room is a grain that tracks membership and publishes room messages via pubsub.
func (*Room) OnActivate ¶
OnActivate initializes the grain state and caches dependencies.
func (*Room) OnDeactivate ¶
OnDeactivate runs when the grain is passivated.
func (*Room) OnReceive ¶
func (r *Room) OnReceive(ctx *actors.GrainContext)
OnReceive handles membership changes and publishes room messages.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is a singleton actor that routes room messages to the correct grain.
func NewRouter ¶
func NewRouter() *Router
NewRouter creates a router that forwards messages to room grains.
func NewRouterWithOptions ¶
func NewRouterWithOptions(opts RouterOptions) *Router
NewRouterWithOptions creates a router with custom options.
func (*Router) Receive ¶
func (r *Router) Receive(ctx *actors.ReceiveContext)
Receive routes incoming messages to the appropriate room grain.
type RouterOptions ¶
RouterOptions configures the router behavior.