arcade library

Properties

errorHandler RouteErrorHandler<RequestContext>?
getter/setter pair
hasLocalConnections bool
Check if there are any local connections
no setter
localConnectionIds Iterable<String>
Get local connection IDs
no setter
route RouteBuilder<RequestContext>
no setter
serverInstanceId String?
Get server instance ID
no setter

Functions

disposeWebSocketStorage() Future<void>
emitTo(String id, dynamic message) → void
emitToAll(dynamic message) → void
emitToRoom(String room, dynamic message) Future<void>
Emit message to all connections in a room
findMatchingRouteAndNotFoundRoute({required List<BaseRoute<RequestContext>> routes, required HttpMethod method, required Uri uri}) → (BaseRoute<RequestContext>?, BaseRoute<RequestContext>?)
getAllConnections() Future<List<WebSocketConnectionInfo>>
Get all active WebSocket connections
getConnectionInfo(String connectionId) Future<WebSocketConnectionInfo?>
Get connection information by ID
getLocalConnections() Future<List<WebSocketConnectionInfo>>
Get WebSocket connections for the current server instance
getRoomMembers(String room) Future<List<String>>
Get room members
getRouteMetadata() List<RouteMetadata>
initializeWebSocketStorage([BaseCacheManager? cacheManager]) → void
joinRoom(String connectionId, String room) Future<void>
Join a WebSocket connection to a room
leaveRoom(String connectionId, String room) Future<void>
Remove a WebSocket connection from a room
overrideErrorHandler(RouteErrorHandler<RequestContext> handler) → void
runServer({required int port, required InitApplication init, LogLevel? logLevel, bool closeServerAfterRoutesSetUp = false}) Future<void>
updateConnectionMetadata(String connectionId, Map<String, dynamic> metadata) Future<void>
Update connection metadata

Typedefs

AfterHookHandler<T extends RequestContext, U extends RequestContext, V, W> = FutureOr<(U, W)> Function(T context, V handleResult)
AfterWebSocketHookHandler<T extends RequestContext, U extends RequestContext, V, W> = FutureOr<(U, W, String)> Function(T context, V handleResult, String id)
BeforeHookHandler<T extends RequestContext, U extends RequestContext> = FutureOr<U> Function(T context)
RouteErrorHandler<T extends RequestContext> = FutureOr Function(T context, ArcadeHttpException error, StackTrace stackTrace)
RouteHandler<T extends RequestContext> = FutureOr Function(T context)
WebSocketHandler<T extends RequestContext> = FutureOr<void> Function(T context, dynamic message, WebSocketManager manager)
WebSocketManager = ({Close close, Emit emit, String id})