pub struct ActorSource;Expand description
Collection of actor-backed source constructors.
Implementations§
Source§impl ActorSource
impl ActorSource
Sourcepub fn actor_ref<T>() -> Source<T, ActorRef<ActorSourceMessage<T>>>where
T: Send + 'static,
pub fn actor_ref<T>() -> Source<T, ActorRef<ActorSourceMessage<T>>>where
T: Send + 'static,
Materializes a typed actor ref that feeds this source.
§Mailbox risk
This source uses Ractor’s regular actor mailbox. It is not backpressured:
a fast sender can enqueue messages faster than the stream consumes them,
and the actor mailbox and this source’s internal buffer can grow without
bound. Prefer ActorSource::actor_ref_with_backpressure when the
producer may outpace downstream demand.
Sourcepub fn typed<T>() -> Source<T, ActorRef<ActorSourceMessage<T>>>where
T: Send + 'static,
pub fn typed<T>() -> Source<T, ActorRef<ActorSourceMessage<T>>>where
T: Send + 'static,
Alias for ActorSource::actor_ref using Datum’s explicit protocol
enum.
Sourcepub fn actor_ref_with_backpressure<T, AckMsg>(
ack_to: ActorRef<AckMsg>,
ack_message: AckMsg,
) -> Source<T, ActorRef<ActorSourceMessage<T>>>
pub fn actor_ref_with_backpressure<T, AckMsg>( ack_to: ActorRef<AckMsg>, ack_message: AckMsg, ) -> Source<T, ActorRef<ActorSourceMessage<T>>>
Materializes a typed actor ref that accepts one element per ack.
The source sends ack_message to ack_to at startup and after each
emitted element. Sending another Element before the ack arrives at the
producer violates the protocol and fails the stream.
Auto Trait Implementations§
impl Freeze for ActorSource
impl RefUnwindSafe for ActorSource
impl Send for ActorSource
impl Sync for ActorSource
impl Unpin for ActorSource
impl UnsafeUnpin for ActorSource
impl UnwindSafe for ActorSource
Blanket Implementations§
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> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage