[−][src]Trait juniper::SubscriptionCoordinator
Global subscription coordinator trait.
With regular queries we could get away with not having some in-between layer, but for subscriptions it is needed, otherwise the integration crates can become really messy and cumbersome to maintain. Subscriptions are also quite a bit more stability sensitive than regular queries, they provide a great vector for DOS attacks and can bring down a server easily if not handled right.
This trait implementation might include the following features:
- contains the schema
- keeps track of subscription connections
- handles subscription start, maintains a global subscription id
- max subscription limits / concurrency limits
- subscription de-duplication
- reconnection on connection loss / buffering / re-synchronisation
'a
is how long spawned connections live for.
Associated Types
type Connection: SubscriptionConnection<S>
[src]
Type of SubscriptionConnection
s this SubscriptionCoordinator
returns
type Error
[src]
Type of error while trying to spawn SubscriptionConnection
Required methods
pub fn subscribe(
&'a self,
_: &'a GraphQLRequest<S>,
_: &'a CtxT
) -> BoxFuture<'a, Result<Self::Connection, Self::Error>>
[src]
&'a self,
_: &'a GraphQLRequest<S>,
_: &'a CtxT
) -> BoxFuture<'a, Result<Self::Connection, Self::Error>>
Return SubscriptionConnection
based on given GraphQLRequest