Introduce a websocket server to `HTTPServer`.
Design to hammer out:
- defining websocket entry endpoints
- defining socket endpoints/protocols
- integrating routes w/ http server
- defining client side implementation
When a socket connects to an entrypoint, create a new event bus for that connection.
Once the bus is created, optionally call some connect callback that takes the socket and bus as parameters.
Pushing an event to the socket's bus serializes the event and emits it as JSON over the socket.
Subscribing to the bus works normally.
When a message is received over the socket, it is parsed, validated, deserialized, then emitted on the bus normally.
When a socket connects to an entrypoint, create a new event bus for that connection.
Once the bus is created, optionally call some connect callback that takes the socket and bus as parameters.
Pushing an event to the socket's bus serializes the event and emits it as JSON over the socket.
Subscribing to the bus works normally.
When a message is received over the socket, it is parsed, validated, deserialized, then emitted on the bus normally.
Introduce a websocket server to
HTTPServer
.Design to hammer out:
When a socket connects to an entrypoint, create a new event bus for that connection.
Once the bus is created, optionally call some connect callback that takes the socket and bus as parameters.
Pushing an event to the socket's bus serializes the event and emits it as JSON over the socket.
Subscribing to the bus works normally.
When a message is received over the socket, it is parsed, validated, deserialized, then emitted on the bus normally.
For a client library, we need a minimal subtree of the event bus, socket implementation, and (de)serializer.