hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Configurable latching of message history on client connection

Open KtorZ opened this issue 3 years ago • 0 comments

Why & What

Currently, when a client connect (via WebSocket) to a Hydra node, the server replays the entire history of event through the connection. This is meant to allow stateless event-driven clients that can be fully driven by the API. However, as the head grows and lasts, this initial dump can be large and unnecessary for some use-cases where clients are only really interested in the latest events.

This ought to be made optional (perhaps as a response to a specific message, or, when passed a specific sub-protocol to the websocket).

Note that, a side (albeit perhaps more important) concern is that this whole history of event is currently maintained in plain memory, effectively causing a memory leak on the server which has to retain all messages floating inside the head. This thereby relate to and should be fixed by #187.

KtorZ avatar May 31 '22 11:05 KtorZ