-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Manage concurrently operating threads without having to spark them -- -- Please see the README on GitHub at -- https://github.com/athanclark/threaded#readme @package threaded @version 0.0.0 module Control.Concurrent.Threaded data ThreadedInternal incoming outgoing ThreadedInternal :: Async () -> Async () -> TChanRW 'Read incoming -> TChanRW 'Write outgoing -> ThreadedInternal incoming outgoing -- | The process's execution thread [thread] :: ThreadedInternal incoming outgoing -> Async () -- | The thread that relays the process's output to the main output [outputRelay] :: ThreadedInternal incoming outgoing -> Async () -- | The process's isolated input [threadInput] :: ThreadedInternal incoming outgoing -> TChanRW 'Read incoming -- | The process's isolated output [threadOutput] :: ThreadedInternal incoming outgoing -> TChanRW 'Write outgoing -- | Segregates concurrently operating threads by some key type k. -- Returns the thread that processes all other threads (this function is -- non-blocking), and the channel that dispenses the outputs from each -- thread. threaded :: forall m stM k input output. Ord k => Show k => MonadIO m => MonadBaseControl IO m stM => Extractable stM => TChanRW 'Write (k, input) -> (TChanRW 'Read input -> TChanRW 'Write output -> m ()) -> m (Async (), TChanRW 'Read (k, output)) module Control.Concurrent.Threaded.Hash -- | Segregates concurrently operating threads by some key type k. -- Returns the thread that processes all other threads (this function is -- non-blocking), and the channel that dispenses the outputs from each -- thread. threaded :: forall m stM k input output. Hashable k => Eq k => Show k => MonadIO m => MonadBaseControl IO m stM => Extractable stM => TChanRW 'Write (k, input) -> (TChanRW 'Read input -> TChanRW 'Write output -> m ()) -> m (Async (), TChanRW 'Read (k, output))