Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Morpheus.Subscriptions.Internal
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 :: forall event (m :: Type -> Type). {..} -> ApiContext 'PUB event m
- SubContext :: forall (m :: Type -> Type) event. {..} -> 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 :: Type -> Type) = 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 :: forall (m :: Type -> Type) m2 ch con. (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 :: forall channel content (m :: Type -> Type). ClientConnectionStore (Event channel content) m -> [(UUID, ClientConnection m)]
- connectionSessionIds :: ClientConnection m -> [Text]
- storedSessions :: forall channel content (m :: Type -> Type). ClientConnectionStore (Event channel content) m -> [(SessionID, ClientSession (Event channel content) m)]
- storedChannels :: forall channel content (m :: Type -> Type). ClientConnectionStore (Event channel content) m -> [(channel, [SessionID])]
- streamApp :: forall ch (m :: Type -> Type) con (api :: API). (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 :: ApolloMessageType
- apolloPayload :: Maybe payload
- data ApolloAction
- = SessionStop ID
- | SessionStart ID GQLRequest
- | ConnectionInit
- | Ping
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 #
Constructors
PubContext | |
Fields
| |
SubContext | |
Fields
|
data Input (api :: API) where Source #
Constructors
InitConnection :: UUID -> Input 'SUB | |
Request :: GQLRequest -> Input 'PUB |
data Store e (m :: Type -> Type) Source #
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.
Constructors
Store | |
Fields
|
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 Methods empty :: ClientConnectionStore (Event ch con) m # |
acceptApolloRequest :: MonadIO m => PendingConnection -> m Connection Source #
Instances
publish :: (Monad m, Eq channel, Hashable channel, Show channel) => Event channel content -> ClientConnectionStore (Event channel content) m -> m () Source #
initDefaultStore :: forall (m :: Type -> Type) m2 ch con. (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 #
toList :: forall channel content (m :: Type -> Type). ClientConnectionStore (Event channel content) m -> [(UUID, ClientConnection m)] Source #
connectionSessionIds :: ClientConnection m -> [Text] Source #
storedSessions :: forall channel content (m :: Type -> Type). ClientConnectionStore (Event channel content) m -> [(SessionID, ClientSession (Event channel content) m)] Source #
storedChannels :: forall channel content (m :: Type -> Type). ClientConnectionStore (Event channel content) m -> [(channel, [SessionID])] Source #
streamApp :: forall ch (m :: Type -> Type) con (api :: API). (Eq ch, Monad m, Hashable ch) => App (Event ch con) m -> Input api -> Output api (Event ch con) m Source #
data ApolloSubscription payload Source #
Constructors
ApolloSubscription | |
Fields
|
Instances
FromJSON a => FromJSON (ApolloSubscription a) Source # | |||||
Defined in Data.Morpheus.Subscriptions.Apollo Methods parseJSON :: Value -> Parser (ApolloSubscription a) # parseJSONList :: Value -> Parser [ApolloSubscription a] # omittedField :: Maybe (ApolloSubscription a) # | |||||
ToJSON a => ToJSON (ApolloSubscription a) Source # | |||||
Defined in Data.Morpheus.Subscriptions.Apollo Methods toJSON :: ApolloSubscription a -> Value # toEncoding :: ApolloSubscription a -> Encoding # toJSONList :: [ApolloSubscription a] -> Value # toEncodingList :: [ApolloSubscription a] -> Encoding # omitField :: ApolloSubscription a -> Bool # | |||||
Generic (ApolloSubscription payload) Source # | |||||
Defined in Data.Morpheus.Subscriptions.Apollo Associated Types
Methods from :: ApolloSubscription payload -> Rep (ApolloSubscription payload) x # to :: Rep (ApolloSubscription payload) x -> ApolloSubscription payload # | |||||
Show payload => Show (ApolloSubscription payload) Source # | |||||
Defined in Data.Morpheus.Subscriptions.Apollo Methods showsPrec :: Int -> ApolloSubscription payload -> ShowS # show :: ApolloSubscription payload -> String # showList :: [ApolloSubscription payload] -> ShowS # | |||||
type Rep (ApolloSubscription payload) Source # | |||||
Defined in Data.Morpheus.Subscriptions.Apollo |
data ApolloAction Source #
Constructors
SessionStop ID | |
SessionStart ID GQLRequest | |
ConnectionInit | |
Ping |