HandlerService constructor
HandlerService({})
Creates a service mounted at mount that dispatches requests to
handler and, when provided, WebSocket upgrades to onConnection.
handler handles non-upgrade HTTP requests. onConnection handles
WebSocket connections after the upgrade completes; omit it to reject
upgrades (see the class docs and handlesWebSocket). onStart/onStop
run on the corresponding lifecycle transitions.
Implementation
HandlerService({
required super.name,
super.mount,
required HubRequestHandler handler,
ConnectionHandler? onConnection,
Future<void> Function()? onStart,
Future<void> Function()? onStop,
}) : _handler = handler,
_onConnection = onConnection,
_onStart = onStart,
_onStop = onStop;