Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- connect :: MonadIO m => m (Input SUB)
- disconnect :: ApiContext SUB e m -> Input SUB -> m ()
- connectionThread :: (MonadUnliftIO m, Eq ch, Hashable ch) => App (Event ch con) m -> ApiContext SUB (Event ch con) m -> m ()
- runStreamWS :: Monad m => ApiContext SUB e m -> Output SUB e m -> m ()
- runStreamHTTP :: Monad m => ApiContext PUB e m -> Output PUB e m -> m GQLResponse
- data ApiContext (api :: API) event (m :: Type -> Type) where
- PubContext :: {..} -> ApiContext PUB event m
- SubContext :: {..} -> ApiContext SUB event m
- data Input (api :: API) where
- InitConnection :: UUID -> Input SUB
- Request :: GQLRequest -> Input PUB
- type PUB = 'PUB
- type SUB = 'SUB
- data Store e m = Store {
- readStore :: m (ClientConnectionStore e m)
- writeStore :: (ClientConnectionStore e m -> ClientConnectionStore e m) -> m ()
- data ClientConnectionStore e (m :: Type -> Type)
- acceptApolloRequest :: MonadIO m => PendingConnection -> m Connection
- data SessionID
- publish :: (Monad m, Eq channel, Hashable channel, Show channel) => Event channel content -> ClientConnectionStore (Event channel content) m -> m ()
- initDefaultStore :: (MonadIO m, MonadIO m2) => m2 (Store (Event ch con) m)
- publishEventWith :: (MonadIO m, Eq channel, Hashable channel, Show channel) => Store (Event channel cont) m -> Event channel cont -> m ()
- empty :: Empty coll => coll
- toList :: ClientConnectionStore (Event channel content) m -> [(UUID, ClientConnection m)]
- connectionSessionIds :: ClientConnection m -> [Text]
- storedSessions :: ClientConnectionStore (Event channel content) m -> [(SessionID, ClientSession (Event channel content) m)]
- storedChannels :: ClientConnectionStore (Event channel content) m -> [(channel, [SessionID])]
- streamApp :: (Eq ch, Monad m, Hashable ch) => App (Event ch con) m -> Input api -> Output api (Event ch con) m
- data ApolloSubscription payload = ApolloSubscription {
- apolloId :: Maybe ID
- apolloType :: Text
- apolloPayload :: Maybe payload
- data ApolloAction
- = SessionStop ID
- | SessionStart ID GQLRequest
- | ConnectionInit
Documentation
disconnect :: ApiContext SUB e m -> Input SUB -> m () Source #
connectionThread :: (MonadUnliftIO m, Eq ch, Hashable ch) => App (Event ch con) m -> ApiContext SUB (Event ch con) m -> m () Source #
runStreamWS :: Monad m => ApiContext SUB e m -> Output SUB e m -> m () Source #
runStreamHTTP :: Monad m => ApiContext PUB e m -> Output PUB e m -> m GQLResponse Source #
data ApiContext (api :: API) event (m :: Type -> Type) where Source #
PubContext | |
| |
SubContext | |
|
data Input (api :: API) where Source #
InitConnection :: UUID -> Input SUB | |
Request :: GQLRequest -> Input PUB |
PubSubStore interface shared GraphQL state between websocket and http server, you can define your own store if you provide write and read methods to work properly Morpheus needs all entries of ClientConnectionStore (+ client Callbacks) that why it is recommended that you use many local ClientStores on every server node rather then single centralized Store.
Store | |
|
data ClientConnectionStore e (m :: Type -> Type) Source #
Instances
Show e => Show (ClientConnectionStore (Event e c) m) Source # | |
Empty (ClientConnectionStore (Event ch con) m) Source # | |
Defined in Data.Morpheus.Subscriptions.ClientConnectionStore empty :: ClientConnectionStore (Event ch con) m # |
acceptApolloRequest :: MonadIO m => PendingConnection -> m Connection Source #
Instances
Generic SessionID Source # | |
Show SessionID Source # | |
Eq SessionID Source # | |
Hashable SessionID Source # | |
type Rep SessionID Source # | |
Defined in Data.Morpheus.Subscriptions.ClientConnectionStore type Rep SessionID = D1 ('MetaData "SessionID" "Data.Morpheus.Subscriptions.ClientConnectionStore" "morpheus-graphql-subscriptions-0.22.1-84bvgIiz9yJ4pEf5uISmMr" 'False) (C1 ('MetaCons "SessionID" 'PrefixI 'True) (S1 ('MetaSel ('Just "cid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UUID) :*: S1 ('MetaSel ('Just "sid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
publish :: (Monad m, Eq channel, Hashable channel, Show channel) => Event channel content -> ClientConnectionStore (Event channel content) m -> m () Source #
initDefaultStore :: (MonadIO m, MonadIO m2) => m2 (Store (Event ch con) m) Source #
initializes empty GraphQL state
publishEventWith :: (MonadIO m, Eq channel, Hashable channel, Show channel) => Store (Event channel cont) m -> Event channel cont -> m () Source #
connectionSessionIds :: ClientConnection m -> [Text] Source #
storedSessions :: ClientConnectionStore (Event channel content) m -> [(SessionID, ClientSession (Event channel content) m)] Source #
storedChannels :: ClientConnectionStore (Event channel content) m -> [(channel, [SessionID])] Source #
streamApp :: (Eq ch, Monad m, Hashable ch) => App (Event ch con) m -> Input api -> Output api (Event ch con) m Source #
data ApolloSubscription payload Source #
ApolloSubscription | |
|