patterns-0.1.1: Common patterns in message-oriented applications

Safe HaskellNone




Puller side of 'Pipeline'



withPuller :: Context -> Service -> String -> LinkType -> OnError_ -> Sink -> (Controller -> IO a) -> IO aSource

Start a puller as a background service:

  • Context - The zeromq context
  • Service - Service name of this worker
  • String - The address to link to
  • LinkType - Whether to connect to or to bind the address; usually you want to connect many workers to one pusher
  • OnError_ - Error handler
  • Sink - The application-defined sink that does the job sent down the pipeline
  • Control a - Control loop


withPipe :: Context -> Service -> (String, LinkType) -> (String, LinkType) -> OnError_ -> (Controller -> IO a) -> IO aSource

A pipeline extends the capacity of the pusher-puller chain; a pipeline connects to a pusher and provides an access point to a set of pullers.

  • Context - The zeromq context
  • Service - The service name of this queue
  • (String, LinkType) - Address and link type, to where pullers connect. Note: if pullers connect, the pipeline must bind the address!
  • (String, LinkType) - Address and link type that pushers bind. Note, again, that if pusher bind, the pipeline must connect to the address!
  • OnError_ - Error handler
  • Control a - Controller action