Class SocketRouteBuilder

Helper class for building websocket APIs using first-class route syntax. This is returned by the Route.socket(...) method, so you'll probably want to use that.

See

Route#socket

Example

Route.socket('/ws/endpoint')
.connected(MyCtrl, (ctrl: MyCtrl) => ctrl.connect)
.event(MyEvent, MyCtrl, (ctrl: MyCtrl) => ctrl.myHandler)

Hierarchy

  • SocketRouteBuilder

Constructors

Properties

Methods

Constructors

Properties

connectionCallback?: Constructable<((ws: WebSocketBus) => Awaitable<void>)>

Callback to execute when a new connection is opened.

handlers: Collection<SocketEventHandler<any>> = ...

Handlers that should be registered with any new socket connections.

Methods