Receive a message, most commonly from the socket.
Receive a message, most commonly from the socket. Received messages are considered owned by the PushSession meaning the session is responsible for cleaning up any associated resources.
The current availability Status of this PushSession.
Representation of a push-based protocol session.
The PushSession is intended to be used with the PushChannelHandle abstraction to provide the interface for building a push-based protocol implementation. In this pattern, events coming from the socket are 'pushed' into the session via the
receive
method with well defined thread behavior. Specifically, thereceive
method will be called with new events from the single-threadedExecutor
available in the associated PushChannelHandle. This provides two key benefits for push-based protocol implementations: - We remove the overhead of theFuture
abstraction intrinsic to theTransport
andDispatcher
based model. - The session itself provides a clear pattern for managing synchronization that works well with thePromise
abstraction by avoiding explicit synchronization. See theREADME.md
for more details.