fn add_message_stream<S>(&mut self, fut: S)
    where
        S: Stream + 'static,
        S::Item: Message,
        A: Handler<S::Item>,
    {
        if self.state() == ActorState::Stopped {
            error!("Context::add_message_stream called for stopped actor.");
        } else {
            self.spawn(ActorMessageStreamItem::new(fut));
        }
    }
/// Registers a stream with the context, ignoring errors.
///
/// This method is similar to `add_stream` but it skips stream
/// errors.
///
/// ```
/// use actix::prelude::*;
/// use futures_util::stream::once;
///
/// #[derive(Message)]
/// #[rtype(result = "()")]
/// struct Ping;
///
/// struct MyActor;
///
/// impl Handler<Ping> for MyActor {
///     type Result = ();
///
///     fn handle(&mut self, msg: Ping, ctx: &mut Context<MyActor>) {
///         println!("PING");
/// #       System::current().stop();
///     }
/// }
///
/// impl Actor for MyActor {
///     type Context = Context<Self>;
///
///     fn started(&mut self, ctx: &mut Context<Self>) {
///         // add messages stream
///         ctx.add_message_stream(once(async { Ping }));
///     }
/// }
///
/// fn main() {
///    System::new().block_on(async {
///        let addr = MyActor.start();
///    });
/// }
/// ```
Registers a stream with the context, ignoring errors.
This method is similar to `add_stream` but it skips stream
errors.


Registers a stream with the context ignoring errors . This method is similar to ` add_stream ` but it skips stream errors .
fn add_message_stream<S>(&mut self, fut: S)
    where
        S: Stream + 'static,
        S::Item: Message,
        A: Handler<S::Item>,
    {
        if self.state() == ActorState::Stopped {
            error!("Context::add_message_stream called for stopped actor.");
        } else {
            self.spawn(ActorMessageStreamItem::new(fut));
        }
    }
fn add_message_stream < S > ( & mut self , fut : S ) where S : Stream + ' static , S :: Item : Message , A : Handler < S :: Item > , { if self . state ( ) == ActorState :: Stopped { error ! ( " " ) ; } else { self . spawn ( ActorMessageStreamItem :: new ( fut ) ) ; } }
Registers a stream with the context, ignoring errors.
Registers a stream with the context ignoring errors .
&mut self
fut
S
&mut self
fut
S
[derive(message)]
None
[rtype(result = "()")]
struct Ping.

struct MyActor.

impl Handler for MyActor {
type Result = ().

fn handle(&mut self, msg: Ping, ctx: &mut Context) {
println!("PING").
struct Ping . struct MyActor . impl Handler for MyActor { type Result = () . fn handle ( &mut self msg : Ping ctx : &mut Context ) { println! ( " PING " ) .
system::current().stop();


impl Actor for MyActor {
type Context = Context.

fn started(&mut self, ctx: &mut Context) {
add messages stream
ctx.add_message_stream(once(async { Ping }));
}
}

fn main() {
System::new().block_on(async {
let addr = MyActor.start();
});
}
```
impl Actor for MyActor { type Context = Context . fn started ( &mut self ctx : &mut Context ) { add messages stream ctx . add_message_stream ( once ( async { Ping } )) ; } } fn main () { System :: new () . block_on ( async { let addr = MyActor . start () ; } ) ; } ` ` `