nqe 0.6.0 → 0.6.1
raw patch · 3 files changed
+13/−8 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +4/−0
- nqe.cabal +4/−4
- src/Control/Concurrent/NQE/Process.hs +5/−4
CHANGELOG.md view
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.6.1+### Changed+- Make it compatible with `newTBQueue` getting `Natural` instead of `Int`.+ ## 0.6.0 ### Changed - Overhaul entire API in a non-backwards-compatible way.
nqe.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: df57adafd63b61ff84b1e42285daa2463bd77e5347ea2f53fc595f690d5d6108+-- hash: 3377d717fc426be2c90dfa88e825d2913ad65e0ffcb96903a62308600f61e950 name: nqe-version: 0.6.0+version: 0.6.1 synopsis: Concurrency library in the style of Erlang/OTP description: Minimalistic actor library inspired by Erlang/OTP with support for supervisor hierarchies and asynchronous messages, as well as abstractions for synchronous communication and easy management of TCP connections. category: Control@@ -37,7 +37,7 @@ hs-source-dirs: src build-depends:- base >=4.7 && <5+ base >=4.8 && <5 , conduit , containers , hashable@@ -57,7 +57,7 @@ ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: async- , base >=4.7 && <5+ , base >=4.8 && <5 , bytestring , conduit , conduit-extra
src/Control/Concurrent/NQE/Process.hs view
@@ -24,6 +24,7 @@ import Control.Concurrent.Unique import Data.Function import Data.Hashable+import Numeric.Natural import UnliftIO -- | 'STM' function that receives an event and does something with it.@@ -130,8 +131,8 @@ newInbox = newTQueueIO >>= \c -> wrapChannel c -- | 'Inbox' with upper bound on number of allowed queued messages.-newBoundedInbox :: MonadIO m => Int -> m (Inbox msg)-newBoundedInbox i = newTBQueueIO i >>= \c -> wrapChannel c+newBoundedInbox :: MonadIO m => Natural -> m (Inbox msg)+newBoundedInbox i = newTBQueueIO (fromIntegral i) >>= \c -> wrapChannel c -- | Send a message to a channel. send :: (MonadIO m, OutChan mbox) => msg -> mbox msg -> m ()@@ -222,7 +223,7 @@ -- | Run a process in the background and pass it to a function. Stop the -- background process once the function returns. Background process exceptions--- are rethrown in the current thread.+-- are re-thrown in the current thread. withProcess :: MonadUnliftIO m => (Inbox msg -> m ()) -> (Process msg -> m a) -> m a withProcess p f = do@@ -230,7 +231,7 @@ withAsync (p i) (\a -> link a >> f (Process a m)) -- | Run a process in the background and return the 'Process' handle. Background--- process exceptions are rethrown in the current thread.+-- process exceptions are re-thrown in the current thread. process :: MonadUnliftIO m => (Inbox msg -> m ()) -> m (Process msg) process p = do (i, m) <- newMailbox