vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function registerWebRPC

Registers a route for handling incoming WebRPC requests.

void registerWebRPC(I) (
  URLRouter router,
  string path,
  I implementation,
  WebRPCPeerCallback!I peer_callback
)
if (is(I == interface));

The endpoint defined by path will attempt to establish a WebSocket connection with the client and subsequently enables bi-directional communication by listening for calls made by the client, as well as invoking the peer_callback to allow the server to make calls, too.

Parameters

NameDescription
router The URLRouter on which to register the endpoint
path Path of the registered endpoint
implementation The API implementation to invoke for incoming method calls
peer_callback Callback invoked for each incoming connection
Authors

Sönke Ludwig

Copyright

© 2024 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.