network-mux
Safe HaskellNone
LanguageHaskell2010

Network.Mux.Bearer

Synopsis

Documentation

data Bearer (m :: Type -> Type) Source #

Low level access to underlying socket or pipe. There are three smart constructors:

Constructors

Bearer (Tracer m BearerTrace -> TimeoutFn m -> SDU -> m Time) (Tracer m BearerTrace -> TimeoutFn m -> [SDU] -> m Time) (Tracer m BearerTrace -> TimeoutFn m -> m (SDU, Time)) SDUSize Int String DiffTime 

type MakeBearerCb (m :: Type -> Type) fd Source #

Arguments

 = DiffTime

Timeout for reading an SDU segment, if negative no timeout is applied. The timeout is not applied to the first SDU segment received from the network, which allows a mini-protocol to have longer timeouts than the one given here (or even have no timeout).

NOTE: a mini-protocol timeouts (which are not responsibility of `network-mux` library) might include the time waiting for the response, receiving all bytes, and the time required to parse the message.

-> fd

file descriptor

-> Maybe (ReadBuffer m)

optional ReadBuffer

-> m (Bearer m) 

Callback which constructs a bearer, see MakeBearer.

newtype MakeBearer (m :: Type -> Type) fd Source #

Construct a bearer using a MakeBearerCb.

Constructors

MakeBearer 

Fields

makeSocketBearer :: MakeBearer IO Socket Source #

Socket Bearer without egress interval.

makeSocketBearer' Source #

Arguments

:: DiffTime

egress interval

-> MakeBearer IO Socket 

makeQueueChannelBearer :: forall (m :: Type -> Type). (MonadSTM m, MonadMonotonicTime m, MonadThrow m) => MakeBearer m (QueueChannel m) Source #