chan-0.0.4.1: Some extra kit for Chans

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.Chan.Extra

Synopsis

Documentation

class ChanScoped (c :: Scope -> * -> *) where Source #

Class for changing the access of a typed channel

Methods

readOnly :: Readable scope => c scope a -> c Read a Source #

writeOnly :: Writable scope => c scope a -> c Write a Source #

allowReading :: Writable scope => c scope a -> c ReadWrite a Source #

allowWriting :: Readable scope => c scope a -> c ReadWrite a Source #

Instances
ChanScoped ChanRW Source # 
Instance details

Defined in Control.Concurrent.Chan.Extra

Methods

readOnly :: Readable scope => ChanRW scope a -> ChanRW Read a Source #

writeOnly :: Writable scope => ChanRW scope a -> ChanRW Write a Source #

allowReading :: Writable scope => ChanRW scope a -> ChanRW ReadWrite a Source #

allowWriting :: Readable scope => ChanRW scope a -> ChanRW ReadWrite a Source #

ChanScoped TChanRW Source # 
Instance details

Defined in Control.Concurrent.Chan.Extra

Methods

readOnly :: Readable scope => TChanRW scope a -> TChanRW Read a Source #

writeOnly :: Writable scope => TChanRW scope a -> TChanRW Write a Source #

allowReading :: Writable scope => TChanRW scope a -> TChanRW ReadWrite a Source #

allowWriting :: Readable scope => TChanRW scope a -> TChanRW ReadWrite a Source #

class ChanExtra (inputC :: * -> *) (outputC :: * -> *) | inputC -> outputC, outputC -> inputC where Source #

Class for extra channel techniques

Methods

debounceStatic Source #

Arguments

:: DiffNanosec

Time to wait before attempting to send the message

-> outputC a 
-> IO (inputC a, Async ()) 

Throw away messages that meet the threshold

throttleStatic Source #

Arguments

:: DiffNanosec

Time to wait before sending the message, for every message

-> outputC a 
-> IO (inputC a, Async ()) 

Refrain from relaying messages that meet the threshold

intersperseStatic Source #

Arguments

:: DiffNanosec

Time to at-least wait to intersperse messages

-> IO a

Get a message to intersperse

-> outputC a 
-> IO (inputC a, Async (), Async ()) 

Intercalate messages while threshold is met