stomp-conduit-0.5.0: Stompl Conduit Client
Copyright(c) Tobias Schoofs
LicenseLGPL
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Network.Mom.Stompl.Client.Conduit

Description

This module provides Conduit interfaces for the stomp-queue library. The interfaces create or receive streams of messages instead of single messages. This approach aims to simplify the integration of messaging into applications by means of well-defined streaming interfaces.

Synopsis

Plain message streams

qSource :: MonadIO m => Reader i -> Int -> ConduitT () (Message i) m () Source #

Reads from a Reader queue with timeout and returns a Producer of type Message i.

The function ends iff the timeout expires and loops infinitely otherwise.

Parameters:

  • Reader i: The input interface, a Stomp Reader.
  • Int: Timeout in microseconds

qSink :: MonadIO m => Writer o -> Type -> [Header] -> ConduitT o Void m () Source #

Writes a stream of messages to a Writer queue and returns a Consumer of type o. The function terminates, when the stream ends.

Parameters:

  • Writer o: The output interface, a Stomp Writer.
  • Type: The mime type of the message content.
  • [Header]: Headers to add to each message.

Multipart messages as streams

qMultiSource :: MonadIO m => Reader i -> Int -> ConduitT () (Message i) m () Source #

Reads from a Reader queue with timeout and returns a Producer of type Message i. The function ends when the timeout expires or after having received a segment that is marked as the last one. Note that multipart messages are not foreseen by the standard. qMultiSink and qMultiSource use a header named "last" to label the last segment of a multipart message.

For parameters, please refer to qSource.

qMultiSink :: MonadIO m => Writer o -> Type -> [Header] -> ConduitT o Void m () Source #

Writes a multipart message to a Writer queue and returns a Consumer of type o. The function terminates, when the stream ends. The last segment is sent with the header ("last", "true"). Note that multipart messages are not foreseen by the standard.

For parameters, please refer to qSink.