packages feed

extensible-effects-concurrent 0.14.0 → 0.14.1

raw patch · 5 files changed

+36/−2 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Control.Eff.Concurrent: data Observing o
+ Control.Eff.Concurrent: handleObservations :: Typeable o => (Server o -> Observation o -> Eff e CallbackResult) -> MessageCallback (Observing o) e
+ Control.Eff.Concurrent.Api.Server2: data Observing o
+ Control.Eff.Concurrent.Api.Server2: handleObservations :: Typeable o => (Server o -> Observation o -> Eff e CallbackResult) -> MessageCallback (Observing o) e
+ Control.Eff.Concurrent.Api.Server2: instance (Data.Typeable.Internal.Typeable o, Control.Eff.Concurrent.Api.Observer.Observable o) => Control.Eff.Concurrent.Api.Observer.Observer (Control.Eff.Concurrent.Api.Server2.Observing o) o
- Control.Eff.Concurrent: callCallback :: forall api_a1byz eff_a1byA reply_a1byD. Getter (ApiHandler api_a1byz eff_a1byA) (Maybe (Api api_a1byz ( 'Synchronous reply_a1byD) -> (reply_a1byD -> Eff eff_a1byA ()) -> Eff eff_a1byA ApiServerCmd))
+ Control.Eff.Concurrent: callCallback :: forall api_a18xu eff_a18xv reply_a18xy. Getter (ApiHandler api_a18xu eff_a18xv) (Maybe (Api api_a18xu ( 'Synchronous reply_a18xy) -> (reply_a18xy -> Eff eff_a18xv ()) -> Eff eff_a18xv ApiServerCmd))
- Control.Eff.Concurrent: castCallback :: forall api_a1byz eff_a1byA. Lens' (ApiHandler api_a1byz eff_a1byA) (Maybe (Api api_a1byz 'Asynchronous -> Eff eff_a1byA ApiServerCmd))
+ Control.Eff.Concurrent: castCallback :: forall api_a18xu eff_a18xv. Lens' (ApiHandler api_a18xu eff_a18xv) (Maybe (Api api_a18xu 'Asynchronous -> Eff eff_a18xv ApiServerCmd))
- Control.Eff.Concurrent: requestHandlerSelector :: forall eff_a1bKP. Lens' (ServerCallback eff_a1bKP) (MessageSelector (Eff eff_a1bKP ApiServerCmd))
+ Control.Eff.Concurrent: requestHandlerSelector :: forall eff_a18JK. Lens' (ServerCallback eff_a18JK) (MessageSelector (Eff eff_a18JK ApiServerCmd))
- Control.Eff.Concurrent: terminateCallback :: forall api_a1byz eff_a1byA. Lens' (ApiHandler api_a1byz eff_a1byA) (Maybe (ExitReason 'Recoverable -> Eff eff_a1byA ()))
+ Control.Eff.Concurrent: terminateCallback :: forall api_a18xu eff_a18xv. Lens' (ApiHandler api_a18xu eff_a18xv) (Maybe (ExitReason 'Recoverable -> Eff eff_a18xv ()))
- Control.Eff.Concurrent: terminationHandler :: forall eff_a1bKP. Lens' (ServerCallback eff_a1bKP) (ExitReason 'Recoverable -> Eff eff_a1bKP ())
+ Control.Eff.Concurrent: terminationHandler :: forall eff_a18JK. Lens' (ServerCallback eff_a18JK) (ExitReason 'Recoverable -> Eff eff_a18JK ())
- Control.Eff.Concurrent.Api.Server: callCallback :: forall api_a1byz eff_a1byA reply_a1byD. Getter (ApiHandler api_a1byz eff_a1byA) (Maybe (Api api_a1byz ( 'Synchronous reply_a1byD) -> (reply_a1byD -> Eff eff_a1byA ()) -> Eff eff_a1byA ApiServerCmd))
+ Control.Eff.Concurrent.Api.Server: callCallback :: forall api_a18xu eff_a18xv reply_a18xy. Getter (ApiHandler api_a18xu eff_a18xv) (Maybe (Api api_a18xu ( 'Synchronous reply_a18xy) -> (reply_a18xy -> Eff eff_a18xv ()) -> Eff eff_a18xv ApiServerCmd))
- Control.Eff.Concurrent.Api.Server: castCallback :: forall api_a1byz eff_a1byA. Lens' (ApiHandler api_a1byz eff_a1byA) (Maybe (Api api_a1byz 'Asynchronous -> Eff eff_a1byA ApiServerCmd))
+ Control.Eff.Concurrent.Api.Server: castCallback :: forall api_a18xu eff_a18xv. Lens' (ApiHandler api_a18xu eff_a18xv) (Maybe (Api api_a18xu 'Asynchronous -> Eff eff_a18xv ApiServerCmd))
- Control.Eff.Concurrent.Api.Server: requestHandlerSelector :: forall eff_a1bKP. Lens' (ServerCallback eff_a1bKP) (MessageSelector (Eff eff_a1bKP ApiServerCmd))
+ Control.Eff.Concurrent.Api.Server: requestHandlerSelector :: forall eff_a18JK. Lens' (ServerCallback eff_a18JK) (MessageSelector (Eff eff_a18JK ApiServerCmd))
- Control.Eff.Concurrent.Api.Server: terminateCallback :: forall api_a1byz eff_a1byA. Lens' (ApiHandler api_a1byz eff_a1byA) (Maybe (ExitReason 'Recoverable -> Eff eff_a1byA ()))
+ Control.Eff.Concurrent.Api.Server: terminateCallback :: forall api_a18xu eff_a18xv. Lens' (ApiHandler api_a18xu eff_a18xv) (Maybe (ExitReason 'Recoverable -> Eff eff_a18xv ()))
- Control.Eff.Concurrent.Api.Server: terminationHandler :: forall eff_a1bKP. Lens' (ServerCallback eff_a1bKP) (ExitReason 'Recoverable -> Eff eff_a1bKP ())
+ Control.Eff.Concurrent.Api.Server: terminationHandler :: forall eff_a18JK. Lens' (ServerCallback eff_a18JK) (ExitReason 'Recoverable -> Eff eff_a18JK ())

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for extensible-effects-concurrent +## 0.14.1++- Add Server2 based observation handling with `handleObservations`+ ## 0.14.0  - Fix/Improve Server2
extensible-effects-concurrent.cabal view
@@ -1,5 +1,5 @@ name:           extensible-effects-concurrent-version:        0.14.0+version:        0.14.1 description:    Please see the README on GitHub at <https://github.com/sheyll/extensible-effects-concurrent#readme> synopsis:       Message passing concurrency as extensible-effect homepage:       https://github.com/sheyll/extensible-effects-concurrent#readme
src/Control/Eff/Concurrent.hs view
@@ -176,6 +176,8 @@                                                 , ToServerPids(..)                                                 , InterruptCallback(..)                                                 , stopServerOnInterrupt+                                                , handleObservations+                                                , Observing()                                                 )  import           Control.Eff.Concurrent.Api.Server
src/Control/Eff/Concurrent/Api/Server2.hs view
@@ -30,6 +30,9 @@   -- ** Interrupt handler   , InterruptCallback(..)   , stopServerOnInterrupt+  -- * Observers+  , handleObservations+  , Observing()   ) where @@ -38,6 +41,7 @@ import           Control.Eff.Log import           Control.Eff.State.Lazy import           Control.Eff.Concurrent.Api+import           Control.Eff.Concurrent.Api.Observer import           Control.Eff.Concurrent.Api.Internal import           Control.Eff.Concurrent.Process import           Control.Monad                  ( (>=>) )@@ -409,3 +413,27 @@ -- @since 0.13.2 stopServerOnInterrupt :: forall eff . HasCallStack => InterruptCallback eff stopServerOnInterrupt = InterruptCallback (pure . StopServer)++-- | Apply a given callback function to incoming 'Observeration's.+--+-- @since 0.14.1+handleObservations+  :: Typeable o+  => (Server o -> Observation o -> Eff e CallbackResult)+  -> MessageCallback (Observing o) e+handleObservations cb = handleCasts $ \(Observered s o) -> cb s o++-- | An 'Api' type for generic 'Observer's, see 'handleObservations'.+--+-- @since 0.14.1+data Observing o+  deriving Typeable++-- | An 'Api' instance for generic 'Observer's, see 'handleObservations'.+--+-- @since 0.14.1+data instance Api (Observing o) 'Asynchronous where+  Observered :: Server o -> Observation o -> Api (Observing o) 'Asynchronous++instance (Typeable o, Observable o) => Observer (Observing o) o where+  observationMessage = Observered
stack.yaml view
@@ -15,7 +15,7 @@ # resolver: #  name: custom-snapshot #  location: "./custom-snapshot.yaml"-resolver: lts-12.9+resolver: lts-12.19  # User packages to be built. # Various formats can be used as shown in the example below.