Classes Files

Wombat::MamaQueue

More…

#include <MamaQueue.h>

Public Functions

  Name
  MamaQueue(void )
  MamaQueue(mamaQueue cQueue)
virtual ~MamaQueue(void )
virtual void create(mamaBridge bridgeImpl)
virtual void create(mamaBridge bridgeImpl, void * nativeQueue)
virtual void dispatch()
virtual void timedDispatch(uint64_t timeout)
virtual void dispatchEvent()
virtual void enqueueEvent(MamaQueueEventCallback * callback, void * closure)
virtual void enqueueEvent(MamaQueueEventCallback & callback, void * closure)
virtual void stopDispatch()
virtual size_t getEventCount()
virtual void setEnqueueCallback(MamaQueueEnqueueCallback * cb, void * closure)
virtual void setQueueMonitorCallback(MamaQueueMonitorCallback * cb, void * closure)
virtual void setHighWatermark(size_t highWatermark)
virtual size_t getHighWatermark(void ) const
virtual void setLowWatermark(size_t lowWatermark)
virtual size_t getLowWatermark(void ) const
virtual void setQueueName(const char * name)
virtual const char * getQueueName() const
virtual const char * getQueueBridgeName() const
virtual void destroy()
virtual void setClosure(void * closure)
virtual void * getClosure()
virtual void destroyTimedWait(long timeout)
virtual void destroyWait()
mamaQueue getCValue()
const mamaQueue getCValue() const
void setCValue(mamaQueue cQueue)

Public Attributes

  Name
MamaQueueImpl * mPimpl

Detailed Description

class Wombat::MamaQueue;

Queue allows applications to dispatch events in order with multiple threads using a single MamaDispatcher for each queue.

Public Functions Documentation

function MamaQueue

MamaQueue(
    void 
)

function MamaQueue

MamaQueue(
    mamaQueue cQueue
)

function ~MamaQueue

virtual ~MamaQueue(
    void 
)

function create

virtual void create(
    mamaBridge bridgeImpl
)

Return: a pointer the queue.

Create a queue. Queues allow applications to dispatch events in order with multiple threads using a single mamaDispatcher for each queue.

Callers should call delete queue when done.

function create

virtual void create(
    mamaBridge bridgeImpl,
    void * nativeQueue
)

function dispatch

virtual void dispatch()

Dispatch message. Blocks and dispatches messages until unblock is called.

function timedDispatch

virtual void timedDispatch(
    uint64_t timeout
)

Dispatch messages from the queue until timeout has elapsed. Some middleware implementations will always block until timeout (dispatching multiple times), whereas others will always unblock once the first event is dispatched or the timeout has elapsed - whichever comes first.

function dispatchEvent

virtual void dispatchEvent()

Dispatch a single event from the specified queue. If there is no event on the queue simply return and do nothing

function enqueueEvent

virtual void enqueueEvent(
    MamaQueueEventCallback * callback,
    void * closure
)

Parameters:

Exceptions:

  • MamaException Not currently implemented for pure Java API.

Add a user event to a queue.

function enqueueEvent

virtual void enqueueEvent(
    MamaQueueEventCallback & callback,
    void * closure
)

function stopDispatch

virtual void stopDispatch()

stopDispatch the queue.

function getEventCount

virtual size_t getEventCount()

Return: size_t The number of the events on the queue.

Returns the number of events currently on the queue.

function setEnqueueCallback

virtual void setEnqueueCallback(
    MamaQueueEnqueueCallback * cb,
    void * closure
)

Parameters:

  • cb Pointer to an instance of MamaQueueEnqueueCallback
  • closure Arbitrary user supplied data. Passed back to onEventEnqueue() for each event enqueued.

Set a callback which will be invoked as each event is added to the underlying event queue.

function setQueueMonitorCallback

virtual void setQueueMonitorCallback(
    MamaQueueMonitorCallback * cb,
    void * closure
)

Parameters:

  • cb Reference to the object which will receive callbacks.
  • closure User supplied data which will be returned as the callbacks are invoked.

Register an object to receive callbacks for monitoring the behaviour of the MamaQueue.

function setHighWatermark

virtual void setHighWatermark(
    size_t highWatermark
)

Specify a high watermark for events on the queue.

The behaviour for setting this value varies depending on the underlying middleware.

LBM: LBM uses an unbounded event queue. Setting this values allows users of the API to receive a callback if the value is exceeded. (See mamaQueue_setQueueMonitorCallback() for setting queue related callbacks) the default behaviour is for the queue to grow unbounded without notifications. The high watermark for LBM can be set for all queues at once by setting the mama.lbm.eventqueuemonitor.queue_size_warning property for the API. Calls to this function will override the value specified in mama.properties.

RV: This will set a queue limit policy of TIBRVQUEUE_DISCARD_FIRST whereby the oldest events in the queue are discarded first. The discard amount will be set with a value of 1. i.e. events will be dropped from the queue one at a time. The default behaviour is an unlimited queue which does not discard events.

function getHighWatermark

virtual size_t getHighWatermark(
    void 
) const

Return the high water mark as set via setHighWaterMark()

function setLowWatermark

virtual void setLowWatermark(
    size_t lowWatermark
)

Parameters:

  • lowWatermark The low water mark.

Set the low watermark. Only supported for Wombat TCP middleware.

function getLowWatermark

virtual size_t getLowWatermark(
    void 
) const

Return the low water mark as set via setLowWaterMark()

function setQueueName

virtual void setQueueName(
    const char * name
)

Parameters:

  • name The string name identifier for the queue.

Associate a name identifier with the event queue. This will be used in queue related logging statements. The string is copied by the API.

function getQueueName

virtual const char * getQueueName() const

Return: The name identifier for the MamaQueue.

Retrieve the string name identifier for the queue as specified from a call to [setQueueName()](classWombat_1_1MamaQueue.html#function-setqueuename). If a name has not been specified via a call to[setQueueName()](classWombat_1_1MamaQueue.html#function-setqueuename) the queue will assume a default name of “NO_NAME”

function getQueueBridgeName

virtual const char * getQueueBridgeName() const

Return: The name identifier for the bridge: “wmw”, “lbm”, or “tibrv”.

Retrieve the string name identifier for the queue’s bridge.

function destroy

virtual void destroy()

Parameters:

  • queue The queue.

Exceptions:

  • MamaStatus with a code of MAMA_STATUS_QUEUE_OPEN_OBJECTS if there are still objects open against the queue.

Destroy a queue. Note that the queue can only be destroyed if all of the objects created on it, (timers, subscriptions etc), have been destroyed.

function setClosure

virtual void setClosure(
    void * closure
)

function getClosure

virtual void * getClosure()

function destroyTimedWait

virtual void destroyTimedWait(
    long timeout
)

Parameters:

  • timeout The time to block for in ms.

Exceptions:

  • MamaStatus with a code of MAMA_STATUS_TIMEOUT if the time elapsed.

Destroy a queue. Note that the queue can only be destroyed if all of the objects created on it, (timers, subscriptions etc), have been destroyed. This function will block for the specified time or until all of the objects have been destroyed and will then destroy the queue.

function destroyWait

virtual void destroyWait()

Destroy a queue. Note that the queue can only be destroyed if all of the objects created on it, (timers, subscriptions etc), have been destroyed. This function will block until all of the objects have been destroyed and will then destroy the queue.

function getCValue

mamaQueue getCValue()

Access to C types for implementation of related classes.

function getCValue

const mamaQueue getCValue() const

function setCValue

void setCValue(
    mamaQueue cQueue
)

This can only be set once and only if the c value is not already set - E.g. from calling create()

Public Attributes Documentation

variable mPimpl

MamaQueueImpl * mPimpl;

Updated on 2023-03-31 at 15:29:25 +0100