pub fn handle<S: Stream<Item = T> + Unpin + 'static>(&mut self, messages: S) -> Result<(), S> {
        if self.closed {
            Err(GlommioError::Closed(ResourceType::Channel(messages)))
        } else {
            let shard = self.shard.clone();
            let consumer = crate::spawn_local(async move { shard.handle(messages).await }).detach();
            self.consumers.push(consumer);
            Ok(())
        }
    }
/// Consume messages from a stream. It will return a
/// [`GlommioError::Closed`] if this [`Sharded`] is closed. Otherwise,
/// the function will return immediately after spawning a background
/// task draining messages from the stream.
///
/// [`GlommioError::Closed`]: crate::GlommioError::Closed
Consume messages from a stream. It will return a
[`GlommioError::Closed`] if this [`Sharded`] is closed. Otherwise,
the function will return immediately after spawning a background
task draining messages from the stream.


Consume messages from a stream . It will return a [ ` GlommioError :: Closed ` ] if this [ ` Sharded ` ] is closed . Otherwise the function will return immediately after spawning a background task draining messages from the stream .
pub fn handle<S: Stream<Item = T> + Unpin + 'static>(&mut self, messages: S) -> Result<(), S> {
        if self.closed {
            Err(GlommioError::Closed(ResourceType::Channel(messages)))
        } else {
            let shard = self.shard.clone();
            let consumer = crate::spawn_local(async move { shard.handle(messages).await }).detach();
            self.consumers.push(consumer);
            Ok(())
        }
    }
pub fn handle < S : Stream < Item = T > + Unpin + ' static > ( & mut self , messages : S ) -> Result < ( ) , S > { if self . closed { Err ( GlommioError :: Closed ( ResourceType :: Channel ( messages ) ) ) } else { let shard = self . shard . clone ( ) ; let consumer = crate :: spawn_local ( async move { shard . handle ( messages ) . await } ) . detach ( ) ; self . consumers . push ( consumer ) ; Ok ( ( ) ) } }
Consume messages from a stream.
Consume messages from a stream .
&mut self
messages
S
&mut self
messages
S