pub struct InprocTransportManager { /* private fields */ }Expand description
Inproc Transport Manager - manages intra-process transport (mpsc channels)
§Design Philosophy
- Workload ↔ Shell communication bridge (not for arbitrary Actor-to-Actor communication)
- Reliable is mandatory, others are created on-demand
- Dynamic multi-channel management: HashMap<String, Channel>
- Bi-directional sharing: Shell and Workload share the same Manager
Implementations§
Source§impl InprocTransportManager
impl InprocTransportManager
Sourcepub fn new() -> Self
pub fn new() -> Self
Create new instance (only creates Reliable channel, others are lazy-initialized)
InprocTransportManager manages intra-process communication channels between Workload and Shell. It does not need ActorId as all communication is within a single process.
Sourcepub async fn create_latency_first_channel(
&self,
channel_id: String,
) -> Arc<Mutex<Receiver<RpcEnvelope>>>
pub async fn create_latency_first_channel( &self, channel_id: String, ) -> Arc<Mutex<Receiver<RpcEnvelope>>>
Create LatencyFirst channel
Sourcepub async fn create_media_track_channel(
&self,
track_id: String,
) -> Arc<Mutex<Receiver<RpcEnvelope>>>
pub async fn create_media_track_channel( &self, track_id: String, ) -> Arc<Mutex<Receiver<RpcEnvelope>>>
Create MediaTrack channel
Sourcepub async fn get_lane(
&self,
payload_type: PayloadType,
identifier: Option<String>,
) -> NetworkResult<DataLane>
pub async fn get_lane( &self, payload_type: PayloadType, identifier: Option<String>, ) -> NetworkResult<DataLane>
Get Lane (with optional channel_id/track_id)
§Arguments
payload_type: PayloadTypeidentifier:Nonefor Reliable/SignalSome(channel_id)for LatencyFirstSome(track_id)for MediaTrack
Sourcepub async fn send_request(
&self,
payload_type: PayloadType,
identifier: Option<String>,
envelope: RpcEnvelope,
) -> NetworkResult<Bytes>
pub async fn send_request( &self, payload_type: PayloadType, identifier: Option<String>, envelope: RpcEnvelope, ) -> NetworkResult<Bytes>
Send request (with response waiting)
Sourcepub async fn send_message(
&self,
payload_type: PayloadType,
identifier: Option<String>,
envelope: RpcEnvelope,
) -> NetworkResult<()>
pub async fn send_message( &self, payload_type: PayloadType, identifier: Option<String>, envelope: RpcEnvelope, ) -> NetworkResult<()>
Send one-way message
Sourcepub async fn recv(&self) -> Option<RpcEnvelope>
pub async fn recv(&self) -> Option<RpcEnvelope>
Receive one message (select first available from all channels)
§Returns
Some(envelope): received message (response matching already handled)None: all channels closed
Sourcepub async fn complete_response(
&self,
request_id: &str,
response_bytes: Bytes,
) -> NetworkResult<()>
pub async fn complete_response( &self, request_id: &str, response_bytes: Bytes, ) -> NetworkResult<()>
Sourcepub async fn complete_error(
&self,
request_id: &str,
error: ProtocolError,
) -> NetworkResult<()>
pub async fn complete_error( &self, request_id: &str, error: ProtocolError, ) -> NetworkResult<()>
Complete a pending request with an error
§Returns
Ok(()): Successfully sent error to waiting senderErr(NetworkError): No pending request found with this ID
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InprocTransportManager
impl !RefUnwindSafe for InprocTransportManager
impl Send for InprocTransportManager
impl Sync for InprocTransportManager
impl Unpin for InprocTransportManager
impl !UnwindSafe for InprocTransportManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more