_tO      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~   None non-portable experimentalNoneReexport from zeromq Reexport from zeromq /Reexport from zeromq (timeout in microseconds) Milliseconds Message body,  needed for complex patterns (e.g. broker) "Identity of a communication peer,  needed for complex patterns (e.g. broker) 'String identifying a service provided, e.g. by a server 2String identifying a stream in the streams device Stream Exception 3Internal error, indicating a code error in library Application-defined error Protocol error  IO error low-level error )Indicates criticality of the error event .The service cannot recover and will terminate %The event has impact on the process, " leaving it in an unkown state. The current operation  (e.g. processing a request)  has not terminated properly, ( but the service is able to continue; . the error may have been caused by a faulty ) request or other temporal conditions.  Error handler for all services 0 that are implemented as background services,  e.g. servers and brokers.  The handler receives the  of the error event, 7 the exception and an additional descriptive string. A good policy is ' to terminate or restart the service  when a  or  error occurs ! and to continue, if possible,  on a plain . D The error handler may perform additional, user-defined actions, $ such as logging the incident or  sending an SMS. A zeromq  AccessPoint - can be bound or connected to its address. ' Only one peer can bind the address, & all other parties have to connect. Connect to the address Bind the address  Simplified Conduit where output  is always  # and no final value is returned. %A conduit that links source and sink / applying some transformation to the stream.  Input is always , $ output and return type may vary. A stream sink wit return type "A stream sink without return type A stream source The IO Resource transformer. ' See the conduit package for details !Streaming the elements of a list )Pass the stream through without applying  any transformation to it Reexport from zeromq      non-portable experimentalNone,Defines the type of a ); . the names of the constructors are similar * to the corresponding ZMQ socket types. Represents a Peer; " corresponds to ZMQ Socket Type  !Represents a Puller; " corresponds to ZMQ Socket Type  "Represents a Pipe; " corresponds to ZMQ Socket Type  #Represents a subscriber; " corresponds to ZMQ Socket Type  $Represents a publisher; " corresponds to ZMQ Socket Type  %Represents a router ' expecting connections from servers; " corresponds to ZMQ Socket Type  &Represents a load balancer, ' expecting connections from clients; " corresponds to ZMQ Socket Type  '.Represents a client and connects to a server; " corresponds to ZMQ Socket Type  (:Represents a server and expects connections from clients; " corresponds to ZMQ Socket Type  );A poll entry describes how to access and identify a socket +&How to address this particular stream ,The address to link to -The zeromq socket type .How to link (bind or connect) /List of  (or topics)  for subscribers 0zeromq socket options 1Control Action 2 Controller 3IO Action with Streamer (e.g. Timeout action) 4Sink with Streamer 5Conduit with Streamer 6DHolds information on streams and the current state of the streamer,  i.e. the current source. 0 Streamers are passed to processing conduits. 7$Starts polling on a set of streams. 5 The actual polling will be run in another thread. ; The current thread continues with the action passed in. < When this action terminates, the streamer stops polling.  Parameters:   - The ZMQ context   - The service name ; indicated for instance in error messages.   - The polling timeout:  < 0 - listens eternally,  0 - returns immediately,  > 0 - timeout in microseconds; # when the timeout expires, the 3 is invoked.  ) - List of ); 0 the streamer will poll over % all list members. , When input is available, ) it is directed to the 4.  3! - Invoked when timeout expires.   - Error handler  4* - The sink, to which the stream is sent. 7 Note that the sink must terminate ) the outgoing stream 8 (using one of the terminating sinks ' described below). 8 Not terminating the stream properly : will result in a zeromq socket error.  1 a - The action to invoke, 7 when the streamer has been started;  The 1 is used to control the device. 8Receiver Sink: 4 Internally a zeromq socket is waiting for input; 4 when input is available, it is send to the sink.  ' Z.Socket a' - The source socket   - receiver timeout  < 0 - listens eternally,  0 - returns immediately,  > 0 - timeout in microseconds; 5 when the timeout expires, the stream terminates ' and the return value is Nothing. 9Sender Source:  The  generates a stream,  which is relayed to the . :Get current source ;5Filter subset of streams; usually you want to filter = a subset of streams to which to relay an incoming stream. > Note that the result is just a list of stream identifiers, > which of course could be used directly in the first place. = A meaningful use of filterstreams would be, for instance:  0 let targets = filterStreams s (/= getSource s) /Where all streams but the source are selected. < Send the  ByteString" segments to the outgoing streams  identified by [].  The stream is terminated. = Send the  ByteString" segments to the outgoing streams  identified by [] # without terminating the stream,  i.e. more segments must be sent. >)Pass all segments of an incoming stream " to a list of outgoing streams.  The stream is terminated. ?9Pass one segment and ignore the remainder of the stream.  The stream is terminated. @8Pass n segments and ignore the remainder of the stream.  The stream is terminated. AEPass while condition is true and ignore the remainder of the stream.  The stream is terminated. BIgnore an incoming stream C(The internal stream that represents the 2. ) StreamSinks can write to this stream, e.g.:   passAll s [internal] 4And the streamer may also receive from this stream, e.g.:  if getSource s == internal D Stop streams EPause streams FResume streams G(Receive a stream through the controller  that was sink'd to the target C. H%Send a stream through the controller I Safely read ; ( ignores the case of the input string  (e.g. "servert" -> () J Safely read ; ( ignores the case of the input string  and, besides "bind" and "connect",  also accepts "bin", "con" and "conn"; 1 intended for use with command line parameters K)Binds or connects a socket to an address Z !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK0 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK0789)*+,-./0('&%$#"! IKJ6543;:<=>?@AB21CDEFHG: ('&%$#"! )*+,-./0123456789:;<=>?@ABCDEFGHIJKportable experimentalNoneLClient data type NCreate a client  with name ,  linking to address , 2 connecting or binding the address according to  3 and finally entering the action, in whose scope  the client lives. ORequest a service:  L6 - The client, through which the service is requested  2 - Timeout in microseconds, -1 to wait eternally. D With timeout = 0, the function returns immediately  with . B When the timeout expires, request is abandoned. 9 In this case, the result of the request  is Nothing.  & - The source of the request stream; @ the format of the request will probably comply 3 with some communication protocol, = as, for instance, in the majordomo pattern.  : - The sink receiving the reply. The result of the sink + is returned as the request's overall result. ; Note that the sink may perform different B actions on the segments of the resulting stream,  e.g. storing data in a database, < and return the number of records received. A ' hello world' Example:  . import qualified Data.Conduit as C . import qualified Data.ByteString.Char8 as B 5 import Network.Mom.Patterns.Basic.Client . import Network.Mom.Patterns.Types  main :: IO () " main = withContext 1 $ \ctx -> " withClient ctx "test" 9 "tcp://localhost:5555" Connect $ \c -> do + mbX <- request c (-1) src snk  case mbX of / Nothing -> putStrLn "No Result" 5 Just x -> putStrLn $ "Result: " ++ x / where src = C.yield (B.pack "hello world") # snk = do mbX <- C.await  case mbX of / Nothing -> return Nothing ; Just x -> return $ Just $ B.unpack x P.Check for a of a previously requested result; 1 use case: request with timout 0, do some work + and check for a result later. A Do not use this function without having requested the service  previously. ! The parameters equal those of O,  but do not include a . LMNOPLMNOPLMMNOPLMNOP non-portable experimentalNoneQ'Start a server as a background process   - The zeromq context   - Service name   - The address to link to  1 - Whether to connect to or to bind the address   - Error handler  0 - The application-defined stream transformer; D the conduit receives the request as input stream ? and should create the output stream that is 6 internally sent back to the client  1 a - Control action <A very simple example, which just sends the incoming stream  back to the client (bounce):  + import Control.Monad (forever) & import Control.Concurrent 5 import Network.Mom.Patterns.Basic.Server . import Network.Mom.Patterns.Types  main :: IO () " main = withContext 1 $ \ctx -> : withServer ctx "Bouncer" "tcp://*:5555" Bind > (\_ _ _ -> return ()) -- ignore error D bounce $ \_ -> forever $ threadDelay 100000  where bounce = passThrough R;A simple load balancer device to link clients and servers.  ! - The zeromq context  - - The service name of this queue  (String, ,) - Address and link type, to where clients > connect. Note if clients connect, = the queue must bind the address!  (String, ,) - Address and link type, to where servers 8 connect. Note, again, that ? if servers connect, the queue must . bind the address!   - Error handler  1 a - 2 action QRQRQRQR non-portable experimentalNoneSPublisher data type TCreate and link a publisher:   - The zeromq context   - The service address  % - How to link (bind or connect) A (Pub -> IO a) - The action, in whose scope the publisher lives UPublish data:  S - The publisher  []1 - List of topics, to which these data should be  published  $ - Create the stream to publish. - The first message segment 5 contains the subscription header,  i.e.$ the comma-separated list of topics VA simple forwarder,  i.e.' a device that connects to a publisher ( and provides an additional endpoint ' for more subscribers to connect to. - A forwarder, hence, is a means to extend  the capacity of a publisher.  ! - The zeromq context  ( - The name of the forwarder  (String, ") - access point for subscribers; 6 usually, you want to bind ? the address, such that subscribers + connect to it.  (String, $) - access point for the publisher; : usually, you want to connect . to the publisher.   - Error handler  1 a - Control loop STUVSTUVSTUVSTUV non-portable experimentalNoneWSubscription data type X>Create a subscription and start the action, in which it lives   - The zeromq context   - The address  ' - The link type, usually Connect  (W8 -> IO a) - The action, in which the subscription lives YSubscribe to a list of topics; A Note that a subscriber has to subscribe to at least one topic  to receive any data.  W - The subscriber  []& - The list of topics to subscribe to ZCheck for new data:  W - The subscriber   - When timeout expires, & the function returns . ! Timeout may be ) -1 - listen eternally, + 0 - return immediately,  > 0 - timeout in microseconds   - Sink the result stream. 4 Note that the subscription header,  i.e. a message segment containing 0 a comma-separated list 0 of the topics, to which ) the data belong,  is dropped. WXYZWXYZWXYZWXYZ non-portable experimentalNone[The pusher data type \.The function in whose scope the pusher lives:   - The zeromq Context   - The address  0 - Link type; usually, you want to bind 2 a pusher to its address  ([3 -> IO a) - Action in whose scope the pusher lives ]Push a job down the pipeline;  the  creates the outgoing stream. [\][\][\][\] non-portable experimentalNone^(Start a puller as a background service:   - The zeromq context  ! - Service name of this worker   - The address to link to  2 - Whether to connect to or to bind the address; < usually you want to connect many workers ! to one pusher   - Error handler  % - The application-defined sink < that does the job sent down the pipeline  1 a - Control loop _(A pipeline extends the capacity of the  pusher-puller chain; # a pipeline connects to a pusher 5 and provides an access point to a set of pullers.  ! - The zeromq context  - - The service name of this queue  (String, ,) - Address and link type, to where pullers ? connect. Note: if pullers connect, @ the pipeline must bind the address!  (String, -) - Address and link type that pushers bind. / Note, again, that > if pusher bind, the pipeline must 4 connect to the address!   - Error handler  1 a - 2 action ^_^_^_^_ non-portable experimentalNoneLMNOPQRSTUVWXYZ[\]^_  non-portable experimentalNone(`MDP Exception a MMI Protocol bGeneric Protocol cBroker exception dClient-side exception eServer-side exception fWorker Frame Type lBroker / Server protocol: / Heartbeat, Ready, Reply, Request, Disconnect rService name sMajordomo protocol client/worker version 1 tMajordomo protocol client/worker version 1 u=Message types (ready, request, reply, heartbeat, disconnect) v=Message types (ready, request, reply, heartbeat, disconnect) w=Message types (ready, request, reply, heartbeat, disconnect) x=Message types (ready, request, reply, heartbeat, disconnect) y=Message types (ready, request, reply, heartbeat, disconnect) z'Majordomo Management Interface (MMI) -  " mmi.service" {'Majordomo Management Interface (MMI) -  " mmi.service" |-Majordomo Management Interface -- responses:  Found ("200" ), NotFound ("404"), NotImplemented ("501") }-Majordomo Management Interface -- responses:  Found ("200" ), NotFound ("404"), NotImplemented ("501") ~-Majordomo Management Interface -- responses:  Found ("200" ), NotFound ("404"), NotImplemented ("501") Client -> Broker: send request "Client -> Broker: receive request Broker -> Client: send reply  Broker -> Client: receive reply  Broker -> Server: send request #Broker -> Server: receive request Server -> Broker: send reply  Server -> Broker: receive reply Broker <-> Server: send heartbeat /Server -> Broker: send connect request (ready) Server -> Broker: disconnect Broker -> Server: disconnect Get frame type Get empty segment Check segment contents Get segment contents  Get identity Get block of identities (envelope) $Create envelope [(identity, B.empty)] 3`abcdefghijklmnopqrstuvwxyz{|}~2`abcdefghijklmnopqrstuvwxyz{|}~2stuyxwvrz{|~}lqponmfkjihg`edcba$`edcbafkjihglqponmrstuvwxyz{|}~  non-portable experimentalNoneClient data type 'Create a client and start the action, $ in whose scope the client lives; Service discovery: ) The function checks whether the client' s service  is provided by the broker. Return values:  Nothing: The broker timed out * Just False: The service is not available % Just True: The service is available Request a service:  6 - The client, through which the service is requested  2 - Timeout in microseconds, -1 to wait eternally. D With timeout = 0, the function returns immediately  with . B When the timeout expires, request is abandoned. 9 In this case, the result of the request  is Nothing.  & - The source of the request stream; @ the format of the request will probably comply 3 with some communication protocol, = as, for instance, in the majordomo pattern.  : - The sink receiving the reply. The result of the sink + is returned as the request's overall result. ; Note that the sink may perform different B actions on the segments of the resulting stream,  e.g. storing data in a database, < and return the number of records received. .Check for a of a previously requested result; 1 use case: request with timout 0, do some work + and check for a result later. A Do not use this function without having requested the service  previously. ! The parameters equal those of ,  but do not include a .  non-portable experimentalNone   non-portable experimentalNone'Start a server as a background process   - The zeromq context   - Service name; 8 the service name is used to register " at the broker.  # - Heartbeat in Milliseconds; B must be synchronised with the broker heartbeat   - The address to link to   - Error handler  0 - The application-defined stream transformer; D the conduit receives the request as input stream ? and should create the output stream that is 6 internally sent back to the client  1 a - Control action  non-portable experimentalNoneG      !"#$%&'()*+,-./0123456789:!"#$&)6      !"#$%&'()*+,-./0123456789:  non-portable experimentalNone'Start a broker as a background process   - The zeromq context   - Service name - ; the service name is for debugging only, 3 there is no relation whatsoever = to the service of the Majordomo Protocol.  0 - The heartbeat interval in milliseconds, * which should be equal 3 for all workers and the broker  % - The address clients connect to  % - The address servers connect to   - Error handler  1 a - Control action ;<=>?@A;<=>?@A non-portable experimentalNone9`abcdefghijklmnopqrstuvwxyz{|}~portable experimentalNone`  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr s t u v w x y z { | } ~        _ a b c d jfEI_fjn _ `        !"#$%&'()*+,-./0123456789:;<=>? @ A B C D EFpatterns-0.1.1Network.Mom.Patterns.TypesNetwork.Mom.Patterns.Streams!Network.Mom.Patterns.Basic.Client!Network.Mom.Patterns.Basic.Server$Network.Mom.Patterns.Basic.Publisher%Network.Mom.Patterns.Basic.Subscriber!Network.Mom.Patterns.Basic.Pusher!Network.Mom.Patterns.Basic.Puller"Network.Mom.Patterns.Broker.Common"Network.Mom.Patterns.Broker.Client"Network.Mom.Patterns.Broker.Server"Network.Mom.Patterns.Broker.BrokerFactoryNetwork.Mom.Patterns.Basic HeartbeatRegistryNetwork.Mom.Patterns.BrokerNetwork.Mom.PatternsSizeContextTimeoutMsecBodyIdentityService IdentifierStreamExceptionOuchAppExc ProtocolExcIOExc SocketExc CriticalityFatalCriticalErrorOnError_LinkTypeConnectBindConduit_ConduitSinkRSinkSourceRIO streamList passThrough withContext AccessTypePeerTPullTPipeTSubTPubTDealerTRouterTClientTServerT PollEntryPollpollIdpollAddpollTypepollLinkpollSubpollOsControl Controller StreamAction StreamSink StreamConduitStreamer withStreams runReceiver runSender getSource filterStreamsstreampartpassAllpass1passN passWhile ignoreStreaminternalstoppauseresumereceivesend parseAccess parseLinklinkClient clService withClientrequest checkResult withServer withQueuePubwithPubissue withForwarderSubwithSub subscribecheckSubPusher withPusherpush withPullerwithPipe MDPExceptionMMIExcMDPExc BrokerExc ClientExc ServerExc FrameType DisconnectT HeartBeatTReplyTRequestTReadyTWFrameWDiscWRequestWReplyWReadyWBeat ServiceNamemdpC01mdpW01xReadyxRequestxReply xHeartBeatxDiscmmiHdrmmiSrvmmiFound mmiNotFoundmmiNimpl mdpCSndReq mdpCRcvReq mdpCSndRep mdpCRcvRep mdpWSndReq mdpWRcvReq mdpWSndRep mdpWRcvRepmdpWBeat mdpWConnectmdpWDisconnect mdpWBrkDisc frameTypeemptychunkgetChunkidentityenvelopetoIs checkService withBroker_addid mkUniqueIdincXbytestring-0.10.0.2Data.ByteString.Internal ByteString$fExceptionStreamExceptionzeromq-haskell-0.8.4 System.ZMQPairPullPushXReqXRepReqRepSystem.ZMQ.InternalSocketctrlCtxctrlCmdctrlOptsstrmSrcstrmIdxstrmCmdstrmPollPollT PollStatePollStpolMappolCmdpolIspolPspolTmopolContpsPollspsMappsCmd psContinue setPsContinue getStreamreadPoll cleanStreamrecv waitForRecvcmdNameaccessmkPollcloseS safeClosecmdStopcmdPausecmdSendgetDestrelay multiSend idsToSockssndCmdretriestrycon setSockOs $fEqPollEntrybaseGHC.BaseString Data.MaybeNothingclSockpubSocksubSockpipSock$fExceptionMDPExceptionmdpSrcmdpSnkHearthbNextMehbNextHehbPeriod tolerancehbPeriodReached newHeartbeatupdMeupdHimcheckMealivetimeAdd ms2nominal handleTmoQueueQqFreeqBusySrvTreeSrvNodesrvNamesrvQWrkTreeWrkNodeWorkerwrkIdwrkHBwrkQStateBusyFreeRegNewRegrgHbrgSrvrgWrkrgSnewReg modifyReg modifyReg_withReg setHbPeriodupdHbinsertremove freeWorkerfreeWorkerWithUpd updWorkerHb updWorkergetServiceName lookupService getWorker checkWorkerburycleansizestatPerServicestat perServiceprintQinitWlookupSgetQlookupQinsertQremoveQremoveWithStateQupdateQupdateWithStateQ setStateQ getWithStateQemptyQ firstFreeQ firstBusyQfirstQtakeIfQtakeIfeqgetList~> handleStream recvClient recvWorker handleReply sendRequest sendReply