pub struct OutprocOutGate { /* private fields */ }Expand description
OutprocOutGate - Outproc transport adapter (outbound)
§Features
- Protobuf serialization: serialize RpcEnvelope to byte stream
- Defaults to PayloadType::RpcReliable for RPC messages
- Maintain pending_requests for Request/Response matching
- Support MediaTrack sending via WebRTC
- Block new requests to peers being cleaned up (closing_peers)
Implementations§
Source§impl OutprocOutGate
impl OutprocOutGate
Sourcepub fn new(
transport_manager: Arc<OutprocTransportManager>,
webrtc_coordinator: Option<Arc<WebRtcCoordinator>>,
) -> Self
pub fn new( transport_manager: Arc<OutprocTransportManager>, webrtc_coordinator: Option<Arc<WebRtcCoordinator>>, ) -> Self
Create new OutprocOutGate
§Arguments
transport_manager: OutprocTransportManager instancewebrtc_coordinator: Optional WebRTC coordinator for MediaTrack support
Sourcepub async fn handle_response(
&self,
request_id: &str,
result: ActorResult<Bytes>,
) -> ActorResult<bool>
pub async fn handle_response( &self, request_id: &str, result: ActorResult<Bytes>, ) -> ActorResult<bool>
Sourcepub async fn pending_count(&self) -> usize
pub async fn pending_count(&self) -> usize
Get pending requests count (for monitoring)
Sourcepub fn get_pending_requests(
&self,
) -> Arc<RwLock<HashMap<String, (ActrId, Sender<ActorResult<Bytes>>)>>>
pub fn get_pending_requests( &self, ) -> Arc<RwLock<HashMap<String, (ActrId, Sender<ActorResult<Bytes>>)>>>
Get pending_requests reference (for WebRtcGate to share)
Source§impl OutprocOutGate
impl OutprocOutGate
Sourcepub async fn send_request_with_type(
&self,
target: &ActrId,
payload_type: PayloadType,
envelope: RpcEnvelope,
) -> ActorResult<Bytes>
pub async fn send_request_with_type( &self, target: &ActrId, payload_type: PayloadType, envelope: RpcEnvelope, ) -> ActorResult<Bytes>
Send request and wait for response (with specified PayloadType).
This is primarily used by language bindings / non-generic RPC paths.
Sourcepub async fn send_request(
&self,
target: &ActrId,
envelope: RpcEnvelope,
) -> ActorResult<Bytes>
pub async fn send_request( &self, target: &ActrId, envelope: RpcEnvelope, ) -> ActorResult<Bytes>
Send request and wait for response (bidirectional communication)
Sourcepub async fn send_message(
&self,
target: &ActrId,
envelope: RpcEnvelope,
) -> ActorResult<()>
pub async fn send_message( &self, target: &ActrId, envelope: RpcEnvelope, ) -> ActorResult<()>
Send one-way message (no response expected)
Sourcepub async fn send_message_with_type(
&self,
target: &ActrId,
payload_type: PayloadType,
envelope: RpcEnvelope,
) -> ActorResult<()>
pub async fn send_message_with_type( &self, target: &ActrId, payload_type: PayloadType, envelope: RpcEnvelope, ) -> ActorResult<()>
Send one-way message with specified PayloadType.
Sourcepub async fn send_media_sample(
&self,
target: &ActrId,
track_id: &str,
sample: MediaSample,
) -> ActorResult<()>
pub async fn send_media_sample( &self, target: &ActrId, track_id: &str, sample: MediaSample, ) -> ActorResult<()>
Sourcepub async fn send_data_stream(
&self,
target: &ActrId,
payload_type: PayloadType,
data: Bytes,
) -> ActorResult<()>
pub async fn send_data_stream( &self, target: &ActrId, payload_type: PayloadType, data: Bytes, ) -> ActorResult<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OutprocOutGate
impl !RefUnwindSafe for OutprocOutGate
impl Send for OutprocOutGate
impl Sync for OutprocOutGate
impl Unpin for OutprocOutGate
impl !UnwindSafe for OutprocOutGate
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