Struct juniper_graphql_ws::ConnectionConfig
source · pub struct ConnectionConfig<CtxT> {
pub context: CtxT,
pub max_in_flight_operations: usize,
pub keep_alive_interval: Duration,
}
Expand description
ConnectionConfig is used to configure the connection once the client sends the ConnectionInit message.
Fields§
§context: CtxT
Custom-provided juniper::Context
.
max_in_flight_operations: usize
Maximum number of in-flight operations that a connection can have.
If this number is exceeded, attempting to start more will result in an error. By default, there is no limit to in-flight operations.
keep_alive_interval: Duration
Interval at which to send keep-alives.
Specifying a Duration::ZERO
will disable keep-alives.
By default, keep-alives are sent every 15 seconds.
Implementations§
source§impl<CtxT> ConnectionConfig<CtxT>
impl<CtxT> ConnectionConfig<CtxT>
sourcepub fn new(context: CtxT) -> Self
pub fn new(context: CtxT) -> Self
Constructs the configuration required for a connection to be accepted.
sourcepub fn with_max_in_flight_operations(self, max: usize) -> Self
pub fn with_max_in_flight_operations(self, max: usize) -> Self
Specifies the maximum number of in-flight operations that a connection can have.
If this number is exceeded, attempting to start more will result in an error. By default, there is no limit to in-flight operations.
sourcepub fn with_keep_alive_interval(self, interval: Duration) -> Self
pub fn with_keep_alive_interval(self, interval: Duration) -> Self
Specifies the interval at which to send keep-alives.
Specifying a Duration::ZERO
will disable keep-alives.
By default, keep-alives are sent every 15 seconds.
Trait Implementations§
source§impl<CtxT: Clone> Clone for ConnectionConfig<CtxT>
impl<CtxT: Clone> Clone for ConnectionConfig<CtxT>
source§fn clone(&self) -> ConnectionConfig<CtxT>
fn clone(&self) -> ConnectionConfig<CtxT>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more