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

Returns the total number of shards

Returns the shard_id associated with ourselves

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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