abla/websocket/rpc
Generated from source.
Import with import "abla/websocket/rpc".
Source: abla/websocket/rpc/entry.ab
WebSocketRpcRoute (class)
class WebSocketRpcRoute(
val method: string,
val handler: (Json) -> Json
)
Pairs an RPC method name with its JSON parameter handler.
WebSocketRpcRouter (class)
class WebSocketRpcRouter(val routes: array<WebSocketRpcRoute>)
Stores the handlers for named JSON RPC methods.
webSocketRpcRouter (fun)
fun webSocketRpcRouter(): WebSocketRpcRouter
Creates an RPC router with no registered methods.
WebSocketRpcRouter.route (extension fun)
fun WebSocketRpcRouter.route(
method: string,
handler: (Json) -> Json
): WebSocketRpcRouter
Registers a nonempty method name and returns the router.
WebSocketRpcRouter.dispatch (extension fun)
fun WebSocketRpcRouter.dispatch(request: Json): Json
Dispatches a request to its first matching method and returns a JSON response with the request ID and a result or error.
WebSocketRpcRouter.serveNext (extension fun)
fun WebSocketRpcRouter.serveNext(
var connection: WebSocketConnection,
limits: JsonLimits = jsonDefaultLimits(),
timeoutMilliseconds: int = 30000
): bool
Reads one JSON request and sends its response, returning false if no request arrives or the send fails.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.