gV      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUNoneThis is a receipt.:No receipt was sent with this interaction. Receiving a R is not an error, but the result of an inconsistent - but harmless - use of  writeQWithg on a queue that does not send receipts. An application should, of course, not try to wait for a . It will never be confirmed.A valid receipt DOpaque Connection handle. Only valid within the action passed to withConnection. VWXYZ [\]^_`abcdefghijklmnoVWXYZ [\bcdeWVXZY [\]^_`abcdefghijklmno(c) Tobias SchoofsLGPL  experimentalportable Safe-Inferred+ YYou hit a bug! This exception is only thrown when something really strange happened  Thrown by abort &Thrown when an error frame is received/Should be thrown by user-defined convertersThrown on connection errors, e.g. connection was closedThrown on transaction errors, e.g. pending acks Thrown on wrong uses of queues, e.g.$ use of a queue outside its scope8Thrown when something against the protocol happens, e.g.[ an unexpected frame is received or a message from a queue that was not subscribedsThrown when a worker thread terminates unexpectedly; usually, this is a consequence of another error (e.g.Y the broker closed the socket) and you will probably receive another exception (e.g. a BrokerException)Currently not used Catches any  C, including asynchronous exceptions coming from internal threadsThrows ! to signal a conversion error. p     pNone qrstuvwxyz qrstuvwxyz qrstuvwxyzNonekAny content received from a queue is wrapped in a message. It is, in particular, the return value of readQ.{The message Identifier|The subscription}The destination~The Ack identifier/The Stomp headers that came with the messageThe MIME type of the content%The length of the encoded content6The transaction, in which the message was received The encoded content The content Message Identifier Options passed to a transaction.5If a message has been received from a queue with OMode option other than f and this message has not yet been acknowledged when the transaction is ready to terminate, the ack is missingH. With this option, the transaction will not commit with missing acks, but abort and raise .>This option has two effects: 1) Internal interactions of the transaction with the broker will request receipts; 2) before ending the transaction, the library will check for receipts that have not yet been confirmed by the broker (including receipts requested by user calls such as writeQ or ackWith).KIf receipts are pending, when the transaction is ready to terminate and  with a value > 0p is given, the transaction will wait for pending receipts; otherwise the transaction will be aborted with L. Note that it usually does not make sense to use this option without , since, in all probability, there will be receipts that have not yet been confirmed when the transaction terminates.?The timeout in milliseconds (not microseconds!) to wait for pending receiptsl. If receipts are pending, when the transaction is ready to terminate, and no timeout or a timeout <= 0 is given, and the option  was passed to withTransaction*, the transaction will be aborted with ; otherwise it will wait until all pending ineractions with the broker have terminated or the timeout has expired - whatever comes first. If the timeout expires first,  is raised. Options passed to a connection!Action to handle Error frames; if the option is not given, an exception is raised on arrival of an error frame. If it is given, one should also pass a value for OWaitError to give the error handler time to execute." (see n for details) for TLS connections. If the option is not given, a plain TCP/IP connection is used.#xConnection timeout in milliseconds; if the broker does not respond to a connect request within this time frame, a C is thrown. If the value is <= 0, the program will wait forever.$/With this option set, "connect" will use a STOMP frame instead of a CONNECT frame%FIdentification: specifies the JMS Client ID for persistent connections&!Authentication: user and password'This option defines the client's bid for negotiating heartbeats providing an accepted lower and upper bound expessed as milliseconds between heartbeats. By default, no heart beats are sent or accepted(UThe maximum size of TCP/IP packets. This option is currently ignored. Instead,   q defines the packet size (currently hard-wired 4KB). The maximum message size is 1024 times this value, i.e. 4MB.)Wait n milliseconds after the connection has been closed by the broker to give the library some time to process the error message (if one has been sent).*Tells the connection to wait n milliseconds for the , sent with # at the end of the session. The Stomp protocol advises to request a receipt and to wait for it before actually closing the socket. Many brokers, however, do not implement this feature (or implement it inappropriately, closing the connection immediately after having sent the receipt). withConnectionl, for this reason, ignores the receipt by default and simply closes the socket after having sent the \ frame. If your broker shows a correct behaviour, it is advisable to use this option.+pAction executed when an Error Frame is received; the typical use case is logging the text of the Error Frame.,Just a nicer word for Rec-VReturns the content of the message in the format produced by an in-bound converter{|}~ !"#$%&'()*+,-    z{|}~ !"#$%&'()*+,-f {|}~ *)('&%$#"!+,-    (c) Tobias SchoofsLGPL  experimentalportableNone!.The : parameters of BThe writer's queue name The writer's 2s The writer's Headers!The writer's (outbound) converter/The 9 parameters of B:The reader's queue name  The reader's 2s The reader's Headers The reader's (inbound) converter0oOut-bound converters are much simpler. Since the application developer knows, which encoding to use, the MIMEF type is not needed. The converter receives only the value of type a and converts it into a  V. A simple example to create an out-bound converter for plain strings could be: let oconv = return . pack12Converters are user-defined actions passed to < (1 ) and > (0) that convert a   to a value of type a (1%) or a value of type a to   (0)). Converters are, hence, similar to put and get in the Binary monad. FThe reason for using explicit, user-defined converters instead of Binary encode and decoder is that the conversion with queues may be much more complex, involving reading configurations or other  actions. Furthermore, we have to distinguish between data types and there binary encoding when sent over the network. This distinction is made by MIME types. Two applications may send the same data type, but one encodes this type as "text/plain", the other as "text/xml". 1" conversions have to consider the MIMEA type and, hence, need more input parameters than provided by decode. encode and decode@, however, can be used internally by user-defined converters.The parameters expected by an 1 converter are:the MIME type of the contentthe content size  the list of  coming with the messagethe content encoded as  .>A simple in-bound converter for plain strings is for instance: !let iconv _ _ _ = return . unpack2"Options that may be passed to < and > and their variants.30Do not automatically add a content-length header4A queue created with 4 will throw  when used outside a .59Expression often used by Ren Artois. Furthermore, if 6 is either  or , then this option forces CZ to send an acknowledgement automatically when a message has been read from the queue. 6The option defines the ( of the queue, which is relevant for 9 only.  is one of: , , .If 6 is not given,  is assumed as default.For more details, see .7A queue created with 7 will wait for the receipt before returning from a call that has issued a request for receipt. This implies that the current thread will yield the processor. D will internally create a request for receipt and wait for the broker to confirm the receipt before returning. Note that, for <$, there is no difference between 7 and 8S. Either option will cause the thread to preempt until the receipt is confirmed.On writing a message, this is not always the preferred method. You may want to fire and forget - and check for the confirmation of the receipt only later. In this case, you will create the : with 86 only and, later, after having sent a message with F , wait for the receipt using M . Note that 7 without 8 has no meaning with D and F. If you want to request a receipt with a message and wait for the broker to confirm it, you have to use both options.It is good practice to use timeout3 with all calls that may wait for receipts, i.e. < and @ with options 8 or 7, or D and F with options 7, or I and K.8A queue created with 8 will request a receipt on all interactions with the broker. The handling of receipts is usually not visible to applications, but may be made visible in the case of sending messages using F. FG return the receipt identifier and the application can later invoke M> to explicitly wait for the broker confirming this receipt.A 9 created with 8H will issue a request for receipt when subscribing to a Stomp queue.9A Queue for receiving messages:A Queue for sending messages.;)Initialises a connection and executes an [ action. The connection lifetime is the scope of this action. The connection handle,  >, that is passed to the action should not be returned from ;. Connections, however, can be shared among threads. In this case, the programmer has to take care not to terminate the action before all other threads working on the connection have finished.Since  is a heavy data type, you should try to reduce the number of connections to the same broker within the same process - there is ideally only one connection per broker in one process. Paramter:%: The broker's hostname or IP-address: The broker's port Q: Control options passed to the connection (including user/password)Header-: List of additional, broker-specific headers(  ->  a): The action to execute. The action receives the connection handle and returns a value of type a! in the  monad.;1 returns the result of the action passed into it.;i will always disconnect from the broker when the action has terminated, even if an exception is raised.Example: 1withConnection "localhost" 61613 [] [] $ \c -> doyThis would connect to a broker listening to the loopback interface, port number 61613. The action is defined after the  hanging do.Internally, connections use concurrent threads; errors are communicated by throwing exceptions to the owner of the connection, where the owner is the thread that created the connection calling ;. It is therefore advisable to start different connections in different threads, so that each thread will receive only exceptions related to the connection it has opened.< Creates a 9% with the lifetime of the connection  . Creating a receiving queue involves interaction with the broker; this may result in preempting the calling thread, depending on the options [2]. Parameters:The connection handle  hA queue name that should be unique in your application. The queue name is used only for debugging. The Stomp destination, i.e.P the name of the queue as it is known to the broker and other applications.A list of options (2).A list of headers (), which will be passed to the broker. A header may be, for instance, a selector that restricts the subscription to this queue, such that only messages with certain attributes (i.e. specific headers) are sent to the subscribing client. Selectors are broker-specific and typically expressed in some kind of query language such as SQL or XPath.An in-bound converter.A usage example to create a 9 with  c and the in-bound converter iconv would be: 2q <- newReader c "TestQ" "/queue/test" [] [] iconv A call to <5 may result in preemption when one of the options 7 or 83 are given; an example for such a call with tmo an  value representing a timeout' in microseconds and the result mbQ of type  is: mbQ <- timeout tmo $ newReader c "TestQ" "/queue/test" [OWaitReceipt] [] oconv case mbQ of Nothing -> -- handle error Just q -> do -- ...*A newReader stores data in the connection cZ. If the lifetime of a reader is shorter than that of its connection it should call =J to avoid memory leaks. In such cases, it is usually preferable to use @.=:Removes all references to the reader from the connection. > Creates a :% with the lifetime of the connection  v. Creating a sending queue does not involve interaction with the broker and will not preempt the calling thread.MA sending queue may be created like in the following code fragment, where oconv/ is an already defined out-bound converter: 2q <- newWriter c "TestQ" "/queue/test" [] [] oconviCurrently no references to the writer are stored in the connection. It is advisable, however, to use A instead of > whenever the lifetime of a writer is shorter than that of the connection. In cases where this is not possible, you should use ?5 when the writer is not needed anymore. Currently ?2 does nothing, but this may change in the future.?&Does nothing, but should be used with >.@ Creates a 9F with limited lifetime. The queue will live only in the scope of the action that is passed as last parameter. The function is useful for readers with a lifetime shorter than that of the connection. When the action terminates, the client unsubscribes from the broker queue - even if an exception is raised.@ returns the result of the action. Since the lifetime of the queue is limited to the action, it should not be returned. Any operation on a reader created by @" outside the action will raise .A usage example is: >x <- withReader c "TestQ" "/queue/test" [] [] iconv $ \q -> doA Creates a : with limited lifetime. The queue will live only in the scope of the action that is passed as last parameter. The function should be used for writers with a lifetime shorter than that of the connection.A returns the result of the action. Since the lifetime of the queue is limited to the action, it should not be returned. Any operation on a writer created by A$ outside the action will raise a .BCreates a pair of (9 i, : o) with limited lifetime. The pair will live only in the scope of the action that is passed as last parameter. The function is useful for readers/writers used in combination, e.g.5 to emulate a client/server kind of communication.B, returns the result of the action passed in.The parameters are:The connection handle  The name of the pair; the reader will be identified by a string with "_r" added to this name, the writer by a string with "_w" added to this name.The description of the 9, /The description of the :, .The application-defined actionThe reason for introducing the reader and writer description is to provide error detection at compile time: It is this way much more difficult to accidently confuse the writer's and the reader's parameters (e.g. passing the writer's 2s to the reader).C?Removes the oldest message from the queue and returns it as E. The message cannot be read from the queue by another call to C within the same connection. Wether other connections will receive the message too depends on the broker and the queue patterns it implements. If the queue is currently empty, the thread will preempt until a message arrives."If the queue was created with 6 other than  and with 5 , then an ack5 will be automatically sent to the broker; if 5; was not set, the message will be registered as pending ack.Note that, when C sends an ackC internally, it will not request a receipt from the broker. The rationale for this design is simplicity. If the function expected a receipt, it would have to either wait for the receipt or return it. In the first case, it would be difficult for the programmer to distinguish, on a timeout, between no message available and no receipt arrived. In the second case, the receipt would need to be returned. This would unnecessarily blow up the interface. If you need the reliability of receipts, you should create the queue without 5 and use I+ to acknowledge the message explicitly.DAdds the value aj as message at the end of the queue. The Mime type as well as the headers are added to the message.,If the queue was created with the option 8, DZ will request a receipt from the broker. If the queue was additionally created with 7, D- will preempt until the receipt is confirmed.FThe Stomp headers are useful for brokers that provide selectors on  subscribe , see < for details.A usage example for a : q of type  may be (nullType is defined as text/plain in Codec.MIME): #writeQ q nullType [] "hello world!"For a : that was created with 8 and 7(, the function should be called with timeout: zmbR <- timeout tmo $ writeQ q nullType [] "hello world!" case mbR of Nothing -> -- error handling Just r -> do -- ...EThis is a variant of D] that overwrites the destination queue defined in the writer queue. It can be used for ad hoc communication and for emulations of client/server-like protocols: the client would pass the name of the queue where it expects the server response in a header; the server would send the reply to the queue indicated in the header using E. The additional $ parameter contains the destination.FThis is a variant of D= that is particularly useful for queues created with 8, but without 7. It returns the ,/, so that it can be waited for later, using M.Note that the behaviour of F7, besides of returning the receipt, is the same as D, i.e., on a queue with 8 and 7 F will wait for the receipt being confirmed. In this case, the returned receipt is, in fact, of no further use for the application.The function is used like: ,r <- writeQWith q nullType [] "hello world!"GThis is a variant of E= that is particularly useful for queues created with 8, but without 7. It returns the ,/, so that it can be waited for later, using M. Please refer to F for more details.HAcknowledges the arrival of % to the broker. It is used with a  c and a  x like: ack c xIAcknowledges the arrival of  to the broker, requests a receipt and waits until it is confirmed. Since it preempts the calling thread, it is usually used with timeout , for a  c, a  x and a timeout in microseconds tmo like: embR <- timeout tmo $ ackWith c x case mbR of Nothing -> -- error handling Just _ -> do -- ...J'Negatively acknowledges the arrival of ( to the broker. For more details see H.K'Negatively acknowledges the arrival of _ to the broker, requests a receipt and waits until it is confirmed. For more details see I.L/Starts a transaction and executes the action in the last parameter. After the action has finished, the transaction will be either committed or aborted even if an exception has been raised. Note that, depending on the options, the way a transaction is terminated may vary, refer to  for details.Transactions cannot be shared among threads. Transactions are internally protected against access from any thread but the one that has actually started the transaction.It is not advisable to use L with timeout. It is preferred to use timeout on the the actions executed within this transaction. Whether and how much time the transaction itself shall wait for the completion of on-going interactions with the broker, in particular pending receipts, shall be controlled by the  option.L" returns the result of the action."The simplest usage example with a  c is: $r <- withTransaction c [] $ \_ -> doGIf the transaction shall use receipts and, before terminating, wait 100ms6 for all receipts to be confirmed by the broker L is called like: eiR <- try $ withTransaction c [OTimeout 100, OWithReceipts] \_ -> do case eiR of Left e -> -- error handling Right x -> do -- .. Note that  is used to catch any  .MWaits for the ,g to be confirmed by the broker. Since the thread will preempt, the call should be protected with timeout, e.g.: dmb_ <- timeout tmo $ waitReceipt c r case mb_ of Nothing -> -- error handling Just _ -> do -- ...N.Aborts the transaction immediately by raising  . The string passed in to N, will be added to the exception message.i./0123456789: !"#$%;&'()*+,-./0<=>?@AB123CDEFG4HIJK5LMN6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZO  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNF; *)('&%$#"!+9:<=>?@AB/.287654310CDFEG-,MLNHIJKQ./0128765439 :  !"#$%;&'()*+,-./0<=>?@AB123CDEFG4HIJK5LMN6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ(c) Tobias SchoofsLGPL  experimentalportableNoneOThe server data typePThe client data typeQ:The function creates a client that lives within its scope. Parameters: : Connection to a Stomp broker): Name of the Client, used for debugging./ i: Description of a reader queue; this is the queue through which the server will send its response.. o: Description of a writer queue; this is the queue through which the server is expecting requests.Pq i o -> IO r: An application-defined action whose scope defines the client's lifetimeR)The client will send the request of type oO and wait for the reply until the timeout exprires. The reply is of type i and is returned as  iX. If the timeout expires before the reply has been received, the function returns [. Parameters:P i o: The client; note that i is the type of the reply, o is the type of the request.: The timeout in microseconds.\: The MIME type of the request.[]: List of additional headers to be sent with the request; note that the function, internally, uses a header named "clientv". This header name, hence, is reserved and must not be used by the application.o: The request SThis function serves as a "delayed" receiver for the case that the timeout of a request has expired. When using this function, it is assumed that a request has been made, but no response has been received. It can be used in time-critical applications, where the client may use the time between request and reply productively, instead of blocking on the reply queue.Use this function with care! It can be easily abused to break the client/server pattern, when it is called without a request having been made before. If, in this case, timout is -1), the application will block for ever. For parameters, please refer to R.T=The function creates a server that lives within its scope. Parameters: : Connection to a Stomp broker): Name of the Server, used for debugging./ i: Description of a reader queue; this is the queue through which clients are expected to send requests.. o: Description of a writer queue; this is the queue through which a specific client will expect the reply. Note that the server will overwrite the destination of this queue using Ea; the destination of this queue, hence, is irrelevant.Oq i o -> IO r: An application-defined action whose scope defines the server's lifetimeUWaits for a client request, calls the application-defined transformer to generate a reply and sends this reply through the queue whose name is indicated by the value of the "client" header. The time a server waits for a request may be restricted by the timeout. Typically, you would call reply with timeout set to -1 (for wait eternallyj). There may be situations, however, where it actually makes sense to restrict the waiting time, i.e.) to perform some housekeeping in between.(Typically, you call reply in a loop like &forever $ reply srv (-1) nullType [] fwhere f is a function of type  'Message' i -> 'IO' o. Parameters:Oo i o: The server; note that i is the request queue and o the reply queue.: The timeout in microseconds.\: The MIME type of the reply.[0]: Additional headers to be sent with the reply. i -> IO o: Transforms the request into a reply - this defines the service provided by this application.O]^_P`abcQdRSTUOPQRSTUPQRSOTUO]^_P`abcQdRSTUe      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdcefghijklmnopqrstuvwxyz{|}~ f       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstustomp-queue-0.2.1Network.Mom.Stompl.Client.Queue#Network.Mom.Stompl.Client.Exception"Network.Mom.Stompl.Client.PatternsFactoryStreamStateData.Conduit.NetworkTLS Data.ConduitNetwork stompl-0.2.0Network.Mom.Stompl.FrameHeartAutoClient ClientIndiAckModeRecNoRecTxConStomplException OuchException AppExceptionBrokerExceptionConvertExceptionConnectException TxExceptionQueueExceptionProtocolExceptionWorkerExceptionSocketExceptiontry convertErrorMessagemsgHdrsmsgTypemsgLenmsgRawToptOAbortMissingAcks OWithReceiptsOTimeoutCoptOEHOTLSOTmoOStomp OClientIdOAuth OHeartBeatOMaxRecv OWaitError OWaitBrokerEHandlerReceipt msgContent WriterDesc ReaderDescOutBoundInBoundQopt ONoContentLenOForceTxOAckOMode OWaitReceipt OWithReceiptReaderWriterwithConnection newReader destroyReader newWriter destroyWriter withReader withWriterwithPairreadQwriteQ writeAdHoc writeQWithwriteAdHocWithackackWithnacknackWithwithTransaction waitReceiptabortServerAClientA withClientrequest checkRequest withServerreplyNoTxSubNoSubparseRecnumericconidsubidtxidrecc mkUniqueConId mkUniqueSubId mkUniqueTxId mkUniqueRecc mkUniqueIdincConincSubincTxincReccincX $fShowRec$fShowTx $fShowSub $fShowCon$fExceptionStomplExceptionParserEHmaxStepsenderreceiverpipeSink pipeSourcestreamparseCparseAllmsgIdmsgSubmsgDestmsgAckmsgTxmsgContMsgIdnetwork-conduit-tls-1.2.0.1Data.Conduit.Network.TLSTLSClientConfig DisconnectMsgNoMsg SubscriptionsubIdsubNamesubModeTxStateTxEnded TxStarted TransactionTrntxIdtxStatetxTmo txAbrtAcktxAbrtRctxAckstxRecs ThreadEntry DestEntrySubEntry ConnectionconIdconAddrconPortconMaxconUsrconPwdconCliconSrvconSesconVersconBeatconChnconBrkconOwnerconEH conHisBeat conMyBeatconWaitconWaitEconSubsconDestsconThrdsconRecsconAcksdelete' deleteBy'mseq mkConnectionisnoWaitstdRecvnoBeatnoAuthnoCliId oWaitBroker oWaitErroroMaxRecv oHeartBeatoAuthoCliIdoStompoTmooTLSoEHfindCon addAckToCon rmAckFromCon addRecToCon rmRecFromConcheckReceiptCon connected getVersiongetEH addSubToCongetSub rmSubFromCon addDestToCongetDest rmDestFromCon setHisTime setMyTime_updConfindTxmkTrnhasTopttmo setTxState addAckToTx rmAckFromTx addRecToTx rmRecFromTxcheckReceiptTx txPendingAck txReceiptsconaddCongetConupdConrmConwithConlogTimelogSend logReceiveaddSubaddDestrmSubrmDestaddTxgetTxupdTx updTxStategetCurTxupdCurTxaddAckrmAckaddRecrmRec forceRmRec checkCurTx checkReceiptrmThisTxrmTx defVersionmkSub mkMessage $fShowMsgId$fEqTransaction$fEqCopt $fShowCopt$fEqConnectionbytestring-0.10.4.0Data.ByteString.Internal ByteStringghc-prim GHC.TypesIOHeaderbaseGHC.BaseStringInt Data.MaybeMaybeRecvQrConrSubrDestrNamerModerAutorRecrFromSendQwConwDestwNamewRecwWaitwCntlwTxwTovers withSender withListenerlisten connectBroker whenConnected disconnectwaitCon withThread throwToOwnerhasQoptackModenewSendQnewRecvQunsub writeGenericack' terminateTxstartTxendTxwaitTxfrmToMsghandleConnected handleMessage handleError handleReceipt handleBeat heartBeatmyMusthisMusttimeAdd ms2nominalfBeginfCommitfAbortfAckfNack fSubscribe fUnsubscribefSend fSendBeat sendFrame mkReceiptmkConFmkDiscFmkSubFmkUnSubFmkSendFmkAckFmkBeginF mkCommitFmkAbortF $fEqWriter $fEqReaderNothing mime-0.4.0.2Codec.MIME.TypeTypeSrvsrvInsrvOutClclChnclInclOutchannel