extensible-effects-concurrent 0.6.3 → 0.7.0
raw patch · 6 files changed
+21/−17 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Eff.Concurrent.Api.Client: whereIsServer :: Member (ServerReader o) e => Eff e (Server o)
- Control.Eff.Log.Channel: closeLogChannelAfter :: (Typeable message, IsString message) => Maybe message -> LogChannel message -> IO a -> IO a
+ Control.Eff.Log.Channel: closeLogChannelAfter :: (Typeable message, IsString message) => LogChannel message -> IO a -> IO a
Files
- ChangeLog.md +9/−0
- extensible-effects-concurrent.cabal +1/−1
- src/Control/Eff/Concurrent/Api/Client.hs +7/−2
- src/Control/Eff/Concurrent/Process/ForkIOScheduler.hs +1/−5
- src/Control/Eff/Concurrent/Process/SingleThreadedScheduler.hs +1/−3
- src/Control/Eff/Log/Channel.hs +2/−6
ChangeLog.md view
@@ -1,5 +1,14 @@ # Changelog for extensible-effects-concurrent +## 0.7.0++- Remove the parameter from `closeLogChannelAfter` that had the optional:+ last-log-message-before-channel-closes++## 0.6.4++- Add `whereIsServer`+ ## 0.6.3 - Add `ServerReader` type alias
extensible-effects-concurrent.cabal view
@@ -1,5 +1,5 @@ name: extensible-effects-concurrent-version: 0.6.3+version: 0.7.0 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/Api/Client.hs view
@@ -12,6 +12,7 @@ , callRegisteredA , ServesApi , ServerReader+ , whereIsServer , registerServer ) where@@ -114,6 +115,10 @@ registerServer :: Server o -> Eff (ServerReader o ': r) a -> Eff r a registerServer = runReader +-- | Get the 'Server' registered with 'registerServer'.+whereIsServer :: Member (ServerReader o) e => Eff e (Server o)+whereIsServer = ask+ -- | Like 'call' but take the 'Server' from the reader provided by -- 'registerServer'. callRegistered@@ -122,7 +127,7 @@ -> Api o ( 'Synchronous reply) -> Eff r reply callRegistered px method = do- serverPid <- ask+ serverPid <- whereIsServer call px serverPid method -- | Like 'callRegistered' but also catch errors raised if e.g. the server@@ -146,5 +151,5 @@ -> Api o 'Asynchronous -> Eff r () castRegistered px method = do- serverPid <- ask+ serverPid <- whereIsServer cast px serverPid method
src/Control/Eff/Concurrent/Process/ForkIOScheduler.hs view
@@ -52,7 +52,6 @@ import Data.Map ( Map ) import qualified Data.Map as Map import Text.Printf-import Data.String -- | Information about a process, needed to implement 'MessagePassing' and -- 'Process' handlers. The message queue is backed by a 'STM.TQueue' and contains@@ -199,10 +198,7 @@ -- top of 'SchedulerIO' effect. All logging is sent to standard output. defaultMainWithLogChannel :: LogChannel LogMessage -> Eff (ConsProcess SchedulerIO) () -> IO ()-defaultMainWithLogChannel logC c = closeLogChannelAfter- (Just (fromString "main process exited"))- logC- (schedule c logC)+defaultMainWithLogChannel logC c = closeLogChannelAfter logC (schedule c logC) scheduleProcessWithShutdownAction :: SchedulerVar
src/Control/Eff/Concurrent/Process/SingleThreadedScheduler.hs view
@@ -21,9 +21,7 @@ import Control.Lens hiding ( (|>) , Empty )-import Control.Monad ( void- , (>=>)- )+import Control.Monad ( void ) import Control.Monad.IO.Class import qualified Data.Sequence as Seq import Data.Sequence ( Seq(..) )
src/Control/Eff/Log/Channel.hs view
@@ -118,12 +118,8 @@ -- 'Exc.SomeException' was thrown, the log channel is killed with -- 'killLogChannel', and the exception is re-thrown. closeLogChannelAfter- :: (Typeable message, IsString message)- => Maybe message- -> LogChannel message- -> IO a- -> IO a-closeLogChannelAfter mGoodbye logC ioAction = do+ :: (Typeable message, IsString message) => LogChannel message -> IO a -> IO a+closeLogChannelAfter logC ioAction = do res <- closeLogAndRethrow `Exc.handle` ioAction closeLogSuccess return res