pub struct RemoteChannelHandle { /* private fields */ }Expand description
Channel handle that communicates through SDK-internal wire protocol transport.
The handle inherits whatever transport its RemoteConfig carries. A config
straight out of RemoteConfig::new has never been connected, so every
operation on a handle built from it refuses with
SdkError::NotConnected rather than reporting a success that reached no
wire. Connect the config first.
Implementations§
Source§impl RemoteChannelHandle
impl RemoteChannelHandle
Sourcepub fn negotiated_version(&self) -> Option<ProtocolVersion>
pub fn negotiated_version(&self) -> Option<ProtocolVersion>
The protocol version the server selected in the current connection’s
ConnectAck, or None before a handshake has completed (including on
the in-process protocol transport, which never opens a connection).
Source§impl RemoteChannelHandle
impl RemoteChannelHandle
Sourcepub fn new(config: &RemoteConfig) -> Result<Self, SdkError>
pub fn new(config: &RemoteConfig) -> Result<Self, SdkError>
Sourcepub fn connection_state(&self) -> ConnectionState
pub fn connection_state(&self) -> ConnectionState
Returns current lifecycle state from the SDK-003 state machine.
Sourcepub fn reconnect_started(&self) -> Result<(), SdkError>
pub fn reconnect_started(&self) -> Result<(), SdkError>
Sourcepub fn track_subscription(&self) -> Result<SubscriptionId, SdkError>
pub fn track_subscription(&self) -> Result<SubscriptionId, SdkError>
Sourcepub fn acknowledge(
&self,
subscription_id: SubscriptionId,
sequence: u64,
) -> Result<(), SdkError>
pub fn acknowledge( &self, subscription_id: SubscriptionId, sequence: u64, ) -> Result<(), SdkError>
Sourcepub const fn server_address(&self) -> &ServerAddress
pub const fn server_address(&self) -> &ServerAddress
Returns remote server address used by this handle.
Source§impl RemoteChannelHandle
impl RemoteChannelHandle
Sourcepub fn publish_with_idempotency_key<M>(
&self,
message: &M,
idempotency_key: &str,
) -> Result<DeliveryAck, SdkError>where
M: Serialize + SchemaValidate,
pub fn publish_with_idempotency_key<M>(
&self,
message: &M,
idempotency_key: &str,
) -> Result<DeliveryAck, SdkError>where
M: Serialize + SchemaValidate,
Publishes a message with an idempotency key and returns a genuine delivery ack.
The idempotency key drives dedup-on-delivery on the server: a re-publish of
the same key is delivered to subscribers at most once. The returned
DeliveryAck reports whether this publish was genuinely accepted by a
subscriber (DeliveryAck::is_accepted), which a caller such as the aion
outbox uses to treat the send as done only on real acceptance. This is
distinct from the backpressure-only publish.
§Errors
Returns SdkError when the message cannot be serialized, the round trip
fails, or the transport cannot produce a genuine delivery ack.
Only with std: without it no transport could carry the key, so no keyed publish is offered rather than one that drops the key (Hermes 7 Oct 08:32).
Sourcepub fn reply_to<M>(
&self,
request: Option<DeliveredId>,
message: &M,
) -> Result<DeliveryAck, SdkError>where
M: Serialize + SchemaValidate,
pub fn reply_to<M>(
&self,
request: Option<DeliveredId>,
message: &M,
) -> Result<DeliveryAck, SdkError>where
M: Serialize + SchemaValidate,
Publishes message as the reply to request and returns a genuine
delivery ack (Fable 4c).
request is the id a delivered message carried
(DeliveredMessage::message): the
reply names it as its causal parent, <boot>:<id>, so the server’s tap
can pair the two and measure the dwell between them. A request that
carried no id (a server before protocol 1.2, or a durable message
replayed from the store) gives a reply with no parent, never an
invented one.
§Errors
Returns SdkError when the message cannot be serialized, the round trip
fails, or the transport cannot produce a genuine delivery ack.
Trait Implementations§
Source§impl ChannelHandle for RemoteChannelHandle
impl ChannelHandle for RemoteChannelHandle
Source§fn subscribe<M>(&self) -> Self::Subscription<M>where
M: DeserializeOwned,
fn subscribe<M>(&self) -> Self::Subscription<M>where
M: DeserializeOwned,
REFUSES. Typed subscription delivery is not implemented on this handle.
The returned stream yields exactly one item — Err(SdkError::Unwired) —
and then ends. It does not touch the transport, so no Subscribe is left
outstanding on the server for a stream that could never deliver.
What this replaces was worse than unimplemented. The old body performed
the real wire Subscribe, registered a subscription in the pool, and
then returned SdkSubscription::empty() — a stream whose poll_next is
Ready(None) immediately and forever. A caller’s
while let Some(m) = sub.next().await exited on the first poll while the
server pumped Deliver frames at a connection nothing was reading.
For real delivery use the lower-level surface that works today:
SubscriptionStream::open plus SubscriptionStream::recv_timeout (or
WebSocketSubscriptionStream::open on the WebSocket transport).
Source§type Subscription<M> = SdkSubscription<M>
where
M: DeserializeOwned
type Subscription<M> = SdkSubscription<M> where M: DeserializeOwned
subscribe for message type M.Source§type ReplyFuture<'a, Resp> = ReadyResult<Resp>
where
Self: 'a,
Resp: DeserializeOwned + 'a
type ReplyFuture<'a, Resp> = ReadyResult<Resp> where Self: 'a, Resp: DeserializeOwned + 'a
request_reply for reply type Resp.