Name | |
---|---|
struct | mamaQueueMonitorCallbacks_ |
Name | |
---|---|
typedef void(MAMACALLTYPE *)(mamaQueue queue, size_t size, void *closure) | mamaQueueHighWatermarkExceededCb |
typedef void(MAMACALLTYPE *)(mamaQueue queue, size_t size, void *closure) | mamaQueueLowWatermarkCb |
typedef struct mamaQueueMonitorCallbacks_ | mamaQueueMonitorCallbacks |
typedef void(MAMACALLTYPE *)(mamaQueue queue, void *closure) | mamaQueueEnqueueCB |
typedef void(MAMACALLTYPE *)(mamaQueue queue, void *closure) | mamaQueueEventCB |
Name | |
---|---|
MAMAExpDLL mama_status | mamaQueue_create(mamaQueue * queue, mamaBridge bridgeImpl) |
MAMAExpDLL mama_status | mamaQueue_create_usingNative(mamaQueue * queue, mamaBridge bridgeImpl, void * nativeQueue) |
MAMAExpDLL mama_status | mamaQueue_canDestroy(mamaQueue queue) |
MAMAExpDLL mama_status | mamaQueue_destroy(mamaQueue queue) |
MAMAExpDLL mama_status | mamaQueue_destroyWait(mamaQueue queue) |
MAMAExpDLL mama_status | mamaQueue_destroyTimedWait(mamaQueue queue, long timeout) |
MAMAExpDLL mama_status | mamaQueue_setHighWatermark(mamaQueue queue, size_t highWatermark) |
MAMAExpDLL mama_status | mamaQueue_getHighWatermark(mamaQueue queue, size_t * highWatermark) |
MAMAExpDLL mama_status | mamaQueue_setLowWatermark(mamaQueue queue, size_t lowWatermark) |
MAMAExpDLL mama_status | mamaQueue_getLowWatermark(mamaQueue queue, size_t * lowWatermark) |
MAMAExpDLL mama_status | mamaQueue_setQueueMonitorCallbacks(mamaQueue queue, mamaQueueMonitorCallbacks * queueMonitorCallbacks, void * closure) |
MAMAExpDLL mama_status | mamaQueue_getEventCount(mamaQueue queue, size_t * count) |
MAMAExpDLL mama_status | mamaQueue_setQueueName(mamaQueue queue, const char * name) |
MAMAExpDLL mama_status | mamaQueue_getQueueName(mamaQueue queue, const char ** name) |
MAMAExpDLL mama_status | mamaQueue_getQueueBridgeName(mamaQueue queue, const char ** name) |
MAMAExpDLL mama_status | mamaQueue_dispatch(mamaQueue queue) |
MAMAExpDLL mama_status | mamaQueue_timedDispatch(mamaQueue queue, uint64_t timeout) |
MAMAExpDLL mama_status | mamaQueue_dispatchEvent(mamaQueue queue) |
MAMAExpDLL mama_status | mamaQueue_enqueueEvent(mamaQueue queue, mamaQueueEventCB callback, void * closure) |
MAMAExpDLL mama_status | mamaQueue_stopDispatch(mamaQueue queue) |
MAMAExpDLL mama_status | mamaQueue_setEnqueueCallback(mamaQueue queue, mamaQueueEnqueueCB callback, void * closure) |
MAMAExpDLL mama_status | mamaQueue_removeEnqueueCallback(mamaQueue queue) |
MAMAExpDLL mama_status | mamaQueue_getNativeHandle(mamaQueue queue, void ** nativeHandle) |
MAMAExpDLL mama_status | mamaDispatcher_create(mamaDispatcher * result, mamaQueue queue) |
MAMAExpDLL mama_status | mamaDispatcher_getQueue(mamaDispatcher dispatcher, mamaQueue * result) |
MAMAExpDLL mama_status | mamaQueue_enableStats(mamaQueue queue) |
MAMAExpDLL mama_status | mamaDispatcher_destroy(mamaDispatcher dispatcher) |
MAMAExpDLL mama_status | mamaQueue_getClosure(mamaQueue queue, void ** closure) |
MAMAExpDLL mama_status | mamaQueue_setClosure(mamaQueue queue, void * closure) |
typedef void(MAMACALLTYPE * mamaQueueHighWatermarkExceededCb) (mamaQueue queue, size_t size, void *closure);
Parameters:
Callback invoked if an upper size limit has been specified for a queue and that limit has been exceeded.
typedef void(MAMACALLTYPE * mamaQueueLowWatermarkCb) (mamaQueue queue, size_t size, void *closure);
Callback invoked when the queue size returns to the lower limit specified. Only Wombat TCP middleware supports low water mark callbacks.
typedef struct mamaQueueMonitorCallbacks_ mamaQueueMonitorCallbacks;
callbacks which may be invoked in response to certain conditions on the specified queue being met.
typedef void(MAMACALLTYPE * mamaQueueEnqueueCB) (mamaQueue queue, void *closure);
Parameters:
Function invoked when an event is enqueued on the queue for which this function was registered.
LBM Bridge: NB! Users may not dispatch events from this function when using with mamaQueue_setEnqueueCallback() The function is invoked from an LBM internal thread. Attempts to dispatch from here will result in a deadlock.
typedef void(MAMACALLTYPE * mamaQueueEventCB) (mamaQueue queue, void *closure);
Parameters:
Function invoked when a user added event fires. Events are added to a queue using the mamaQuque_enqueueEvent()
.
MAMAExpDLL mama_status mamaQueue_create(
mamaQueue * queue,
mamaBridge bridgeImpl
)
Parameters:
Return:
Create a queue. Queues allow applications to dispatch events in order with multiple threads using a single mamaDispatcher for each queue. A queue must be associated with a particular middleware.
MAMAExpDLL mama_status mamaQueue_create_usingNative(
mamaQueue * queue,
mamaBridge bridgeImpl,
void * nativeQueue
)
MAMAExpDLL mama_status mamaQueue_canDestroy(
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the queue can be destroyed. MAMA_STATUS_QUEUE_OPEN_OBJECTS if there are still objects open against the queue. MAMA_STATUS_NULL_ARG
Check to see if a queue can be destroyed. The queue cannot be destroyed if there are currently open event objects on it.
MAMAExpDLL mama_status mamaQueue_destroy(
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful. 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.
MAMAExpDLL mama_status mamaQueue_destroyWait(
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
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.
MAMAExpDLL mama_status mamaQueue_destroyTimedWait(
mamaQueue queue,
long timeout
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful. 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.
MAMAExpDLL mama_status mamaQueue_setHighWatermark(
mamaQueue queue,
size_t highWatermark
)
Parameters:
Return: MAMA_STATUS_OK if the function returns successfully.
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 at runtime. Callbacks can be disabled by setting this value to 0, effectively disabling high watermark checking.
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.
MAMAExpDLL mama_status mamaQueue_getHighWatermark(
mamaQueue queue,
size_t * highWatermark
)
Parameters:
Get the value of the high water mark for the specified queue. A value of 0 will be returned if no high water mark was previously specified.
MAMAExpDLL mama_status mamaQueue_setLowWatermark(
mamaQueue queue,
size_t lowWatermark
)
Parameters:
Set the low water mark for the queue. Only supported by Wombat TCP middleware.
The low watermark must be >1 and < highWaterMark otherwise this method returns MAMA_STATUS_INVALID_ARG. For this reason the high water mark must be set before invoking this method.
MAMAExpDLL mama_status mamaQueue_getLowWatermark(
mamaQueue queue,
size_t * lowWatermark
)
Parameters:
Get the value of the low water mark for the specified queue. A value of 1 will be returned if no low water mark was previously specified.
MAMAExpDLL mama_status mamaQueue_setQueueMonitorCallbacks(
mamaQueue queue,
mamaQueueMonitorCallbacks * queueMonitorCallbacks,
void * closure
)
Specify a set of callbacks which may be invoked in response to certain conditions arising on the queue.
The behaviour here is middleware specific as not all will support all callbacks.
LBM: When the high watermark is exceeded the mamaQueueHighWatermarkExceededCb callback will invoked each time an event on the queue is dispatched until such time as the number of events on the queue falls below the high watermark.
MAMAExpDLL mama_status mamaQueue_getEventCount(
mamaQueue queue,
size_t * count
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Writes the number of events currently on the specified queue to the address specified by count.
MAMAExpDLL mama_status mamaQueue_setQueueName(
mamaQueue queue,
const char * name
)
Parameters:
Return:
Associate a name identifier with the event queue. This will be used in queue related logging statements. The string is copied by the API.
MAMAExpDLL mama_status mamaQueue_getQueueName(
mamaQueue queue,
const char ** name
)
Parameters:
Return:
Get the string name identifier for the specified event queue.
MAMAExpDLL mama_status mamaQueue_getQueueBridgeName(
mamaQueue queue,
const char ** name
)
Parameters:
Return:
Get the string name identifier of the bridge for the specified event queue. Name will be either “wmw”, “tibrv”, or “lbm”.
MAMAExpDLL mama_status mamaQueue_dispatch(
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Dispatch messages from the queue. This call blocks and dispatches until mamaQueue_stopDispatch() is called.
MAMAExpDLL mama_status mamaQueue_timedDispatch(
mamaQueue queue,
uint64_t timeout
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
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.
MAMAExpDLL mama_status mamaQueue_dispatchEvent(
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the function succeeds.
Dispatch a single event from the specified queue. If there is no event on the queue simply return and do nothing.
MAMAExpDLL mama_status mamaQueue_enqueueEvent(
mamaQueue queue,
mamaQueueEventCB callback,
void * closure
)
Parameters:
Return: MAMA_STATUS_OK if the function succeeds.
Add an user event to a queue. Currently only supported using Wombat Middleware.
MAMAExpDLL mama_status mamaQueue_stopDispatch(
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Unblock the queue as soon as possible. This will cause mamaDispatchers to exit. Creating a new dispatcher will resume dispatching events.
MAMAExpDLL mama_status mamaQueue_setEnqueueCallback(
mamaQueue queue,
mamaQueueEnqueueCB callback,
void * closure
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Register the specified callback function to receive a callback each time an event is enqueued on the specified mamaQueue
MAMAExpDLL mama_status mamaQueue_removeEnqueueCallback(
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
If the specified queue has a registered enqueue callback it is unregistered and the previously supplied callback function will no longer receive callbacks for enqueue events.
MAMAExpDLL mama_status mamaQueue_getNativeHandle(
mamaQueue queue,
void ** nativeHandle
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Get the native middleware implementation queue handle (if applicable for the implementation). This function is for internal use only.
MAMAExpDLL mama_status mamaDispatcher_create(
mamaDispatcher * result,
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Create a mamaDispatcher. The dispatcher spawns a thread to dispatch events from a queue. It will continue to dispatch events until it is destroyed or mamaQueue_stopDispatch is called.
Only a single dispatcher can be created for a given queue. Attempting to create multiple dispatchers for a queue will result in and error. Dispatching message from a single queue with multiple threads results in messages arriving out of order and sequence number gaps for market data subscriptions.
MAMAExpDLL mama_status mamaDispatcher_getQueue(
mamaDispatcher dispatcher,
mamaQueue * result
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Return the queue associated with the dispatcher.
MAMAExpDLL mama_status mamaQueue_enableStats(
mamaQueue queue
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Enable stats logging on queue
MAMAExpDLL mama_status mamaDispatcher_destroy(
mamaDispatcher dispatcher
)
Parameters:
Return: MAMA_STATUS_OK if the call is successful.
Destroy the dispatcher and stop dispatching events. If mamaDispatcher_createQueue() was used then the underlying queue will be destroyed as well.
MAMAExpDLL mama_status mamaQueue_getClosure(
mamaQueue queue,
void ** closure
)
MAMAExpDLL mama_status mamaQueue_setClosure(
mamaQueue queue,
void * closure
)
/* $Id$
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Technologies, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef MamaQueueH__
#define MamaQueueH__
#include <mama/mama.h>
#include <mama/types.h>
#include <mama/status.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef void (MAMACALLTYPE *mamaQueueHighWatermarkExceededCb) (mamaQueue queue,
size_t size,
void* closure);
typedef void (MAMACALLTYPE *mamaQueueLowWatermarkCb) (mamaQueue queue,
size_t size,
void* closure);
typedef struct mamaQueueMonitorCallbacks_
{
mamaQueueHighWatermarkExceededCb onQueueHighWatermarkExceeded;
mamaQueueLowWatermarkCb onQueueLowWatermark;
} mamaQueueMonitorCallbacks;
typedef void (MAMACALLTYPE *mamaQueueEnqueueCB)(mamaQueue queue, void* closure);
typedef void (MAMACALLTYPE *mamaQueueEventCB)(mamaQueue queue, void* closure);
MAMAExpDLL
extern mama_status
mamaQueue_create (mamaQueue* queue, mamaBridge bridgeImpl);
MAMAExpDLL
extern mama_status
mamaQueue_create_usingNative (mamaQueue* queue, mamaBridge bridgeImpl, void* nativeQueue);
MAMAExpDLL
extern mama_status
mamaQueue_canDestroy(mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaQueue_destroy (mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaQueue_destroyWait(mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaQueue_destroyTimedWait(mamaQueue queue, long timeout);
MAMAExpDLL
extern mama_status
mamaQueue_setHighWatermark (mamaQueue queue,
size_t highWatermark);
MAMAExpDLL
extern mama_status
mamaQueue_getHighWatermark (mamaQueue queue,
size_t* highWatermark);
MAMAExpDLL
extern mama_status
mamaQueue_setLowWatermark (mamaQueue queue,
size_t lowWatermark);
MAMAExpDLL
extern mama_status
mamaQueue_getLowWatermark (mamaQueue queue,
size_t* lowWatermark);
MAMAExpDLL
extern mama_status
mamaQueue_setQueueMonitorCallbacks (
mamaQueue queue,
mamaQueueMonitorCallbacks* queueMonitorCallbacks,
void* closure);
MAMAExpDLL
extern mama_status
mamaQueue_getEventCount (mamaQueue queue, size_t* count);
MAMAExpDLL
extern mama_status
mamaQueue_setQueueName (mamaQueue queue, const char* name);
MAMAExpDLL
extern mama_status
mamaQueue_getQueueName (mamaQueue queue, const char** name);
MAMAExpDLL
extern mama_status
mamaQueue_getQueueBridgeName (mamaQueue queue, const char** name);
MAMAExpDLL
extern mama_status
mamaQueue_dispatch (mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaQueue_timedDispatch (mamaQueue queue, uint64_t timeout);
MAMAExpDLL
extern mama_status
mamaQueue_dispatchEvent (mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaQueue_enqueueEvent (mamaQueue queue,
mamaQueueEventCB callback,
void* closure);
MAMAExpDLL
extern mama_status
mamaQueue_stopDispatch (mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaQueue_setEnqueueCallback (mamaQueue queue,
mamaQueueEnqueueCB callback,
void* closure);
MAMAExpDLL
extern mama_status
mamaQueue_removeEnqueueCallback (mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaQueue_getNativeHandle (mamaQueue queue,
void** nativeHandle);
MAMAExpDLL
extern mama_status
mamaDispatcher_create (mamaDispatcher* result, mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaDispatcher_getQueue (mamaDispatcher dispatcher, mamaQueue* result);
MAMAExpDLL
extern mama_status
mamaQueue_enableStats(mamaQueue queue);
MAMAExpDLL
extern mama_status
mamaDispatcher_destroy (mamaDispatcher dispatcher);
MAMAExpDLL
extern mama_status
mamaQueue_getClosure (mamaQueue queue, void** closure);
MAMAExpDLL
extern mama_status
mamaQueue_setClosure (mamaQueue queue, void* closure);
#if defined(__cplusplus)
}
#endif
#endif /*MamaQueueH__*/
Updated on 2023-03-31 at 15:29:16 +0100