Availability:
:- use_module(library(http/hub)).
[det]hub_create(+Name,
-Hub, +Options)- Hub
.name - The name of the hub (the Name argument)
queues.event- Message queue to which the hub
thread(s)can listen.
Options:
- read_timeout(+Seconds)
- Maximum time to wait for the remainder of a message after the first data
of the message has arrived. If a client exceeds this time, it is
disconnected. Default is 60. Use
infiniteto wait forever.
After creating a hub, the application normally creates a thread that listens to Hub.queues.event and exposes some mechanisms to establish websockets and add them to the hub using hub_add/3.
- See also
- http_upgrade_to_websocket/3 establishes a websocket from the SWI-Prolog webserver.