pub struct EmbeddedChannelHandle { /* private fields */ }Expand description
Channel handle that publishes through direct in-process references.
Publishes — and only publishes. ChannelHandle::subscribe on this handle
REFUSES with SdkError::Unwired: embedded mode has no in-process delivery
path, and this handle will not hand back an empty stream that looks like a
live subscription with nothing on it yet.
Implementations§
Source§impl EmbeddedChannelHandle
impl EmbeddedChannelHandle
Sourcepub fn new(config: &EmbeddedConfig) -> Self
pub fn new(config: &EmbeddedConfig) -> Self
Creates an embedded channel handle from direct in-process configuration.
Sourcepub fn channel_name(&self) -> &str
pub fn channel_name(&self) -> &str
Returns the application-visible channel name.
Trait Implementations§
Source§impl ChannelHandle for EmbeddedChannelHandle
impl ChannelHandle for EmbeddedChannelHandle
Source§fn subscribe<M>(&self) -> Self::Subscription<M>where
M: DeserializeOwned,
fn subscribe<M>(&self) -> Self::Subscription<M>where
M: DeserializeOwned,
REFUSES. Embedded typed subscription delivery is unimplemented.
The returned stream yields exactly one item — Err(SdkError::Unwired) —
and then ends. It touches no backend, because there is no backend method
it could touch.
What this replaces reported a success it could not have had. The old body
returned SdkSubscription::empty, a stream whose poll_next is
Ready(None) immediately and forever, so a caller’s
while let Some(m) = sub.next().await exited on the first poll and read
as “subscribed, nothing published yet” — indistinguishable from a quiet
channel, and permanent.
There is no in-process alternative to point at: EmbeddedChannelBackend
is publish-only, so a backend installed through
EmbeddedConfig::with_channel_backend gives this surface nothing. For
real delivery use a remote handle against a running server —
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.