WebSocketWrite

Type Alias WebSocketWrite 

Source
pub type WebSocketWrite = Option<Arc<RwLock<SplitSink<WebSocketStream<BoxedStream>, Message>>>>;
Expand description

Handle used by services to push WebSocket messages back to a client.

  • Some(lock) — the service was invoked from the local WebSocket, which supports async back-channel notifications. Services can acquire the write lock and push arbitrary Message::Text(_) frames.
  • None — the service was invoked from the remote WebSocket (outbound connection to wss.unpispas.es). There is no streaming back-channel; the service must respond only through the return value of run().

Use send_message from the pispas_modules::utils module to write through the lock safely.

Aliased Type§

pub enum WebSocketWrite {
    None,
    Some(Arc<RwLock<SplitSink<WebSocketStream<BoxedStream>, Message>>>),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(Arc<RwLock<SplitSink<WebSocketStream<BoxedStream>, Message>>>)

Some value of type T.