morpheus-graphql-subscriptions 0.18.0 → 0.19.0
raw patch · 6 files changed
+18/−18 lines, 6 filesdep ~aesondep ~morpheus-graphql-appdep ~morpheus-graphql-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, morpheus-graphql-app, morpheus-graphql-core
API changes (from Hackage documentation)
- Data.Morpheus.Subscriptions.Internal: data ApiContext (api :: API) event (m :: * -> *)
+ Data.Morpheus.Subscriptions.Internal: data ApiContext (api :: API) event (m :: Type -> Type)
- Data.Morpheus.Subscriptions.Internal: data ClientConnectionStore e (m :: * -> *)
+ Data.Morpheus.Subscriptions.Internal: data ClientConnectionStore e (m :: Type -> Type)
Files
- changelog.md +2/−0
- morpheus-graphql-subscriptions.cabal +6/−8
- src/Data/Morpheus/Subscriptions/ClientConnectionStore.hs +4/−4
- src/Data/Morpheus/Subscriptions/Internal.hs +2/−2
- src/Data/Morpheus/Subscriptions/Stream.hs +3/−3
- src/Data/Morpheus/Subscriptions/WebSockets.hs +1/−1
changelog.md view
@@ -1,5 +1,7 @@ # Changelog +## 0.19.0 - 21.03.2022+ ## 0.18.0 - 08.11.2021 ## 0.17.0 - 25.02.2021
morpheus-graphql-subscriptions.cabal view
@@ -3,11 +3,9 @@ -- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack------ hash: 54dee88f65b459eb5f01523b3d409aee9fc4679f02786b1f5bbd046abfc869a7 name: morpheus-graphql-subscriptions-version: 0.18.0+version: 0.19.0 synopsis: Morpheus GraphQL Subscriptions description: Build GraphQL APIs with your favourite functional language! category: web, graphql, subscriptions@@ -42,11 +40,11 @@ src ghc-options: -Wall build-depends:- aeson >=1.4.4.0 && <=1.6+ aeson >=1.4.4.0 && <3 , base >=4.7 && <5 , bytestring >=0.10.4 && <0.11- , morpheus-graphql-app >=0.18.0 && <0.19.0- , morpheus-graphql-core >=0.18.0 && <0.19.0+ , morpheus-graphql-app >=0.19.0 && <0.20.0+ , morpheus-graphql-core >=0.19.0 && <0.20.0 , mtl >=2.0 && <=3.0 , relude >=0.3.0 , text >=1.2.3.0 && <1.3@@ -70,8 +68,8 @@ , base >=4.7 && <5 , bytestring >=0.10.4 && <0.11 , directory >=1.0- , morpheus-graphql-app >=0.18.0 && <0.19.0- , morpheus-graphql-core >=0.18.0 && <0.19.0+ , morpheus-graphql-app >=0.19.0 && <0.20.0+ , morpheus-graphql-core >=0.19.0 && <0.20.0 , mtl >=2.0 && <=3.0 , relude >=0.3.0 , tasty
src/Data/Morpheus/Subscriptions/ClientConnectionStore.hs view
@@ -59,7 +59,7 @@ } deriving (Show, Generic, Eq, Hashable) -data ClientConnection (m :: * -> *) = ClientConnection+data ClientConnection (m :: Type -> Type) = ClientConnection { connectionId :: UUID, connectionCallback :: ByteString -> m (), -- one connection can have multiple subscription session@@ -74,7 +74,7 @@ sid ClientConnection {..} = ClientConnection {connectionSessionIds = connectionSessionIds <> [sid], ..} -data ClientSession e (m :: * -> *) = ClientSession+data ClientSession e (m :: Type -> Type) = ClientSession { sessionChannel :: Channel e, sessionCallback :: e -> m ByteString }@@ -113,7 +113,7 @@ upd = mapAt cantFindConnection connectionCallback (cid sid) clientConnections cantFindConnection _ = pure () -newtype Updates e (m :: * -> *) = Updates+newtype Updates e (m :: Type -> Type) = Updates { _runUpdate :: ClientConnectionStore e m -> ClientConnectionStore e m } @@ -192,7 +192,7 @@ -- stores active client connections -- every registered client has ID -- when client connection is closed client(including all its subscriptions) can By removed By its ID-data ClientConnectionStore e (m :: * -> *) where+data ClientConnectionStore e (m :: Type -> Type) where ClientConnectionStore :: { clientConnections :: HashMap UUID (ClientConnection m), clientSessions :: HashMap SessionID (ClientSession (Event channel content) m),
src/Data/Morpheus/Subscriptions/Internal.hs view
@@ -92,8 +92,8 @@ -- 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 recomended that you use many local ClientStores on evenry server node--- rathen then single centralized Store.+-- that why it is recommended that you use many local ClientStores on every server node+-- rather then single centralized Store. data Store e m = Store { readStore :: m (ClientConnectionStore e m), writeStore :: (ClientConnectionStore e m -> ClientConnectionStore e m) -> m ()
src/Data/Morpheus/Subscriptions/Stream.hs view
@@ -76,7 +76,7 @@ run :: ApiContext SUB e m -> Updates e m -> m () run SubContext {updateStore} (Updates changes) = updateStore changes -data ApiContext (api :: API) event (m :: * -> *) where+data ApiContext (api :: API) event (m :: Type -> Type) where PubContext :: { eventPublisher :: event -> m () } ->@@ -91,8 +91,8 @@ data Output (api :: API)- e- (m :: * -> *)+ (e :: Type)+ (m :: Type -> Type) where SubOutput :: { streamWS :: ApiContext SUB e m -> m (Either ByteString [Updates e m])
src/Data/Morpheus/Subscriptions/WebSockets.hs view
@@ -34,7 +34,7 @@ import qualified Network.WebSockets as WS import Relude --- support old version of Websockets+-- support old version of WebSockets pingThread :: Connection -> IO () -> IO () #if MIN_VERSION_websockets(0,12,6)