Function twilight_gateway::create_bucket

source ·
pub fn create_bucket<F, Q>(
    bucket_id: u16,
    concurrency: u16,
    total: u32,
    config: Config<Q>,
    per_shard_config: F
) -> impl ExactSizeIterator<Item = Shard<Q>>
where F: Fn(ShardId, ConfigBuilder<Q>) -> Config<Q>, Q: Clone,
Expand description

Create a single bucket’s worth of shards.

Passing a primary config is required. Further customization of this config may be performed in the callback.

Internally calls create_iterator with (bucket_id..total).step_by(concurrency).

§Panics

Panics if bucket_id >= total, bucket_id >= concurrency, or concurrency >= total.

Panics if loading TLS certificates fails.