Actor.prototype._onBeforeConnect(opts: OnBeforeConnectOptions<this>): ConnState | Promise<ConnState>
Called whenever a new client connects to the actor. Clients can pass parameters when connecting, accessible via opts.parameters
.
The returned value becomes the connection's initial state and can be accessed later via connection.state
.
Connections cannot interact with the actor until this method completes successfully. Throwing an error will abort the connection.
opts: OnBeforeConnectOptions<this>
- Options for the connection.
ConnState | Promise<ConnState>