Struct twilight_gateway_queue::LocalQueue
source · [−]pub struct LocalQueue(_);
Expand description
A local, in-process implementation of a Queue
which manages the
connection attempts of one or more shards.
The queue will take incoming requests and then queue them, releasing one of the requests every 6 seconds. The queue is necessary because there’s a ratelimit on how often shards can initiate sessions.
You usually won’t need to handle this yourself, because the Cluster
will
do that for you when managing multiple shards.
When not to use this
This queue implementation is “local”, meaning it’s intended to be used if you manage shards only in this process. If you run shards in multiple different processes (do you utilize microservices a lot?), then you must not use this implementation. Shards across multiple processes may create new sessions at the same time, which is bad.
It should also not be used for very large sharding, for that the
LargeBotQueue
can be used.
If you can’t use this, look into an alternative implementation of the
Queue
, such as the gateway-queue
broker.
Implementations
sourceimpl LocalQueue
impl LocalQueue
Trait Implementations
sourceimpl Clone for LocalQueue
impl Clone for LocalQueue
sourcefn clone(&self) -> LocalQueue
fn clone(&self) -> LocalQueue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LocalQueue
impl Debug for LocalQueue
sourceimpl Default for LocalQueue
impl Default for LocalQueue
sourceimpl Queue for LocalQueue
impl Queue for LocalQueue
Auto Trait Implementations
impl !RefUnwindSafe for LocalQueue
impl Send for LocalQueue
impl Sync for LocalQueue
impl Unpin for LocalQueue
impl !UnwindSafe for LocalQueue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more