pipes-courier-0.1.0.0: Pipes utilities for interfacing with the courier message-passing framework.

Safe HaskellTrustworthy

Pipes.Courier

Contents

Description

pipes utilities for interfacing with the courier message-passing framework.

Synopsis

Endpoints

Pipes which operate on Endpoints.

send :: MonadIO m => Endpoint -> Name -> Consumer' Message m rSource

send ep name sends the message supplied upstream through the given Endpoint ep to the Name name.

Analogous to sendMessage_.

send' :: MonadIO m => Endpoint -> Name -> Consumer' Message m ()Source

send' ep name is like send except the pipe closes if an error occurs while finding a suitable Transport.

broadcast :: MonadIO m => Endpoint -> [Name] -> Consumer' Message m rSource

broadcast ep names sends the message supplied upstream through the given Endpoint ep to the Names specified in the list of names.

Analogous to broadcastMessage_.

post :: MonadIO m => Endpoint -> Consumer' Message m rSource

post ep posts the message supplied by upstream to the given Endpoint ep without using a transport.

Analogous to postMessage.

receive :: MonadIO m => Endpoint -> Producer' Message m rSource

receive ep forwards the next message available from the given Endpoint ep downstream.

Analogous to receiveMessage.

receiveTimeout :: MonadIO m => Endpoint -> Int -> Producer' (Maybe Message) m rSource

receiveTimeout ep tout is like receive except operates using a timeout. If a message becomes available before the given timeout then downstream will receive a Just, otherwise it will receive Nothing (but the pipe will remain open).

Analogous to receiveMessageTimeout.

receiveTimeout' :: MonadIO m => Endpoint -> Int -> Producer' Message m ()Source

receiveTimeout' ep tout is like receiveTimeout except the pipe closes if no messages are received within the timeout period.

select :: MonadIO m => Endpoint -> (Message -> Maybe v) -> Producer' v m rSource

select ep f takes all of the messages available from the given Endpoint ep and applies them to the function f. Messages will only be sent downstream if f returns Just.

Analogous to selectMessage.

selectTimeout :: MonadIO m => Endpoint -> Int -> (Message -> Maybe v) -> Producer' (Maybe v) m rSource

selectTimeout ep tout f is like select except operates using a timeout. If a message is selected before the given timeout then downstream will receive a Just, otherwise it will receive Nothing (but the pipe will remain open).

Analogous to selectMessageTimeout.

selectTimeout' :: MonadIO m => Endpoint -> Int -> (Message -> Maybe v) -> Producer' v m ()Source

selectTimeout' ep tout f is like selectTimeout except the pipe closes if no messages are received within the timeout period.

Re-exports