Close the underlying session
Close the underlying session
Calls to this method are bounced through the serial-executor to help alleviate race conditions where the underlying session is replaced concurrently with the underlying session being closed.
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.
The current availability Status of this PushSession.
Replaces the current PushSession, directing inbound events to the new session.
Replaces the current PushSession, directing inbound events to the new session.
other than no longer receiving inbound messages, the replaced session is still active and it is the responsibility of the caller to manage the lifecycle of the replaced session.
,It is unsafe to update the reference from outside of serial executor and may result in undefined behavior.
Proxy PushSession which can update the underlying session.
Thread safety considerations
-
receive
is only intended to be called from within the serial executor, which is a general rule in allPushSession
implementations. -updateRef
should be called only from within the handle's serial executor. This is to avoid race conditions between closing the underlying session (which happens in the serial executor) and replacing it with a new session: if replacing happens in the same thread, there is no need to worry about broadcasting close events from the old session to the new one. -close
andstatus
are safe to call from any thread.