#[non_exhaustive]pub struct PendingPushConnect<'address> { /* private fields */ }Expand description
A pending push-client connection with a caller-selected setup deadline.
The duration has two setup-only roles: it is the maximum wait for any one
socket read, and it supplies the wall-clock deadline for each synchronous
control-frame reply. A registration connect performs two control exchanges
(Connect/ConnectAck and WorkerRegister/WorkerRegisterAck), each with
its own deadline. The duration does not bound the TCP open or socket writes,
and it is removed before the background reader starts.
Implementations§
Source§impl<'address> PendingPushConnect<'address>
impl<'address> PendingPushConnect<'address>
Sourcepub fn with_auth_token(self, auth_token: &[u8]) -> Self
pub fn with_auth_token(self, auth_token: &[u8]) -> Self
Adds the authentication token carried by the connect handshake.
Sourcepub fn with_registration(self, registration: WorkerRegistration) -> Self
pub fn with_registration(self, registration: WorkerRegistration) -> Self
Adds the worker registration exchange that runs after the connect handshake and before the background reader starts.
Sourcepub fn connect(self) -> Result<PushClient, SdkError>
pub fn connect(self) -> Result<PushClient, SdkError>
Connects, performs the configured synchronous control exchanges, and starts the background reader.
§Errors
Returns SdkError::Connection when the TCP connection or socket
configuration fails or authentication is rejected, and
SdkError::Protocol when another control exchange is rejected or the
socket cannot be cloned for the reader thread.