Struct glommio::channels::sharding::Sharded [−][src]
pub struct Sharded<T: Send, H> { /* fields omitted */ }
Expand description
The public interface for sharding
Implementations
Join a full mesh for sharding
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.
Sends an individual message to a given shard.
This functions returns GlommioError::Closed
if this Sharded
is
closed, or InvalidInput
if the destination id is invalid.
This function ignores the sharding function.
Sends an individual message to the correct shard.
The correct shard is calculated using the sharding function in this
Sharded
object.
This functions returns GlommioError::Closed
if this Sharded
is
closed.
Close this Sharded
and wait for all existing background tasks to
finish. No more consuming task will be spawned, but incoming
messages from the streams consumed by existing back ground tasks
will not be rejected. So it would be important to truncate the streams
from upstream before calling this method to prevent it from hanging.
Trait Implementations
Auto Trait Implementations
impl<T, H> !RefUnwindSafe for Sharded<T, H>
impl<T, H> !UnwindSafe for Sharded<T, H>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more