Name | |
---|---|
struct | mamaPublisherCallbacks |
Name | |
---|---|
enum | mamaPublisherState { MAMA_PUBLISHER_UNKNOWN = 0, MAMA_PUBLISHER_CREATING = 1, MAMA_PUBLISHER_LIVE = 2, MAMA_PUBLISHER_DESTROYING = 3, MAMA_PUBLISHER_DESTROYED_BRIDGE = 4, MAMA_PUBLISHER_DESTROYING_WAIT_BRIDGE = 5, MAMA_PUBLISHER_DESTROYED = 6} |
typedef void(MAMACALLTYPE *)(mamaPublisher publisher, mamaMsg msg, mama_status status, void *closure) | mamaThrottledSendCompleteCb |
typedef void(MAMACALLTYPE *)(mamaPublisher publisher, void *closure) | mama_publisherOnCreateCb |
typedef void(MAMACALLTYPE *)(mamaPublisher publisher, void *closure) | mama_publisherOnDestroyCb |
typedef void(MAMACALLTYPE *)(mamaPublisher publisher, mama_status status, const char *info, void *closure) | mama_publisherOnErrorCb |
typedef void(MAMACALLTYPE *)(mamaPublisher publisher, mama_status status, const char *info, void *closure) | mama_publisherOnSuccessCb |
typedef struct mamaPublisherCallbacks | mamaPublisherCallbacks |
Name | |
---|---|
MAMAExpDLL mama_status | mamaPublisher_create(mamaPublisher * result, mamaTransport tport, const char * symbol, const char * source, const char * root) |
MAMAExpDLL mama_status | mamaPublisher_createWithCallbacks(mamaPublisher * result, mamaTransport tport, mamaQueue queue, const char * symbol, const char * source, const char * root, mamaPublisherCallbacks * cb, void * closure) |
MAMAExpDLL mama_status | mamaPublisher_send(mamaPublisher publisher, mamaMsg msg) |
MAMAExpDLL mama_status | mamaPublisher_sendWithThrottle(mamaPublisher publisher, mamaMsg msg, mamaThrottledSendCompleteCb sendCompleteCb, void * closure) |
MAMAExpDLL mama_status | mamaPublisher_sendFromInboxWithThrottle(mamaPublisher publisher, mamaInbox inbox, mamaMsg msg, mamaThrottledSendCompleteCb sendCompleteCb, void * closure) |
MAMAExpDLL mama_status | mamaPublisher_sendFromInbox(mamaPublisher publisher, mamaInbox inbox, mamaMsg msg) |
MAMAExpDLL mama_status | mamaPublisher_sendReplyToInboxHandle(mamaPublisher publisher, mamaMsgReply replyAddress, mamaMsg reply) |
MAMAExpDLL mama_status | mamaPublisher_sendReplyToInbox(mamaPublisher publisher, mamaMsg request, mamaMsg reply) |
MAMAExpDLL mama_status | mamaPublisher_destroy(mamaPublisher publisher) |
MAMAExpDLL mama_status | mamaPublisher_destroyEx(mamaPublisher publisher) |
MAMAExpDLL mama_status | mamaPublisher_getTransport(mamaPublisher publisher, mamaTransport * transport) Return the mamaTransport for this publisher. |
MAMAExpDLL mama_status | mamaPublisherCallbacks_allocate(mamaPublisherCallbacks ** cb) |
MAMAExpDLL mama_status | mamaPublisherCallbacks_deallocate(mamaPublisherCallbacks * cb) |
MAMAExpDLL mama_status | mamaPublisher_getUserCallbacks(mamaPublisher publisher, mamaPublisherCallbacks * cb) |
MAMAExpDLL mama_status | mamaPublisher_getState(mamaPublisher publisher, mamaPublisherState * state) |
MAMAExpDLL const char * | mamaPublisher_stringForState(mamaPublisherState state) |
MAMAExpDLL mama_status | mamaPublisher_getRoot(mamaPublisher publisher, const char ** root) |
MAMAExpDLL mama_status | mamaPublisher_getSource(mamaPublisher publisher, const char ** source) |
MAMAExpDLL mama_status | mamaPublisher_getSymbol(mamaPublisher publisher, const char ** symbol) |
Enumerator | Value | Description |
---|---|---|
MAMA_PUBLISHER_UNKNOWN | 0 | The state of the publisher is unknown. The publisher is being created and waiting on the bridge (sync wait) |
MAMA_PUBLISHER_CREATING | 1 | The publisher is live. |
MAMA_PUBLISHER_LIVE | 2 | |
MAMA_PUBLISHER_DESTROYING | 3 | |
MAMA_PUBLISHER_DESTROYED_BRIDGE | 4 | |
MAMA_PUBLISHER_DESTROYING_WAIT_BRIDGE | 5 | |
MAMA_PUBLISHER_DESTROYED | 6 |
Responsible for publishing mama messages. The publisher states
typedef void(MAMACALLTYPE * mamaThrottledSendCompleteCb) (mamaPublisher publisher, mamaMsg msg, mama_status status, void *closure);
Parameters:
Prototype for callback invoked when a message sent with either mamaPublisher_sendWithThrottle() or mamaPublisher_sendFromInboxWithThrottle() has been sent from the throttle queue.
Messages sent on the throttle queue are no longer destroyed by the API. It is the responsibility of the application developer to manage the lifecycle of any messages sent on the throttle.
typedef void(MAMACALLTYPE * mama_publisherOnCreateCb) (mamaPublisher publisher, void *closure);
typedef void(MAMACALLTYPE * mama_publisherOnDestroyCb) (mamaPublisher publisher, void *closure);
typedef void(MAMACALLTYPE * mama_publisherOnErrorCb) (mamaPublisher publisher, mama_status status, const char *info, void *closure);
typedef void(MAMACALLTYPE * mama_publisherOnSuccessCb) (mamaPublisher publisher, mama_status status, const char *info, void *closure);
typedef struct mamaPublisherCallbacks mamaPublisherCallbacks;
Callbacks for publisher events. If any cb is NULL then the callback will not be made.
MAMAExpDLL mama_status mamaPublisher_create(
mamaPublisher * result,
mamaTransport tport,
const char * symbol,
const char * source,
const char * root
)
Parameters:
Create a mama publisher for the corresponding transport. If the transport is a marketdata transport, as opposed to a “basic” transport, the topic corresponds to the symbol. For a basic transport, the source and root get ignored.
MAMAExpDLL mama_status mamaPublisher_createWithCallbacks(
mamaPublisher * result,
mamaTransport tport,
mamaQueue queue,
const char * symbol,
const char * source,
const char * root,
mamaPublisherCallbacks * cb,
void * closure
)
Parameters:
Create a mama publisher for a corresponding transport. Include publisher event callbacks.
MAMAExpDLL mama_status mamaPublisher_send(
mamaPublisher publisher,
mamaMsg msg
)
Parameters:
Send a message from the specified publisher.
MAMAExpDLL mama_status mamaPublisher_sendWithThrottle(
mamaPublisher publisher,
mamaMsg msg,
mamaThrottledSendCompleteCb sendCompleteCb,
void * closure
)
Parameters:
Send a message with the throttle. The lifecycle of the message sent is controlled by the user of the API. The callback indicates when the API is no longer using the message and can be destroyed/reused by the application.
MAMAExpDLL mama_status mamaPublisher_sendFromInboxWithThrottle(
mamaPublisher publisher,
mamaInbox inbox,
mamaMsg msg,
mamaThrottledSendCompleteCb sendCompleteCb,
void * closure
)
MAMAExpDLL mama_status mamaPublisher_sendFromInbox(
mamaPublisher publisher,
mamaInbox inbox,
mamaMsg msg
)
MAMAExpDLL mama_status mamaPublisher_sendReplyToInboxHandle(
mamaPublisher publisher,
mamaMsgReply replyAddress,
mamaMsg reply
)
Parameters:
Send a reply in response to a request to an inbox.
MAMAExpDLL mama_status mamaPublisher_sendReplyToInbox(
mamaPublisher publisher,
mamaMsg request,
mamaMsg reply
)
Parameters:
Send a reply in response to a request to an inbox.
MAMAExpDLL mama_status mamaPublisher_destroy(
mamaPublisher publisher
)
Parameters:
Destroy the publisher.
MAMAExpDLL mama_status mamaPublisher_destroyEx(
mamaPublisher publisher
)
Parameters:
Destroy the publisher after queueing request to publisher’s queue/thread
MAMAExpDLL mama_status mamaPublisher_getTransport(
mamaPublisher publisher,
mamaTransport * transport
)
Return the mamaTransport
for this publisher.
Parameters:
Return: mama_status return code can be one of: MAMA_STATUS_NULL_ARG MAMA_STATUS_OK
MAMAExpDLL mama_status mamaPublisherCallbacks_allocate(
mamaPublisherCallbacks ** cb
)
Parameters:
Allocate a publisher events callback structure. This is done to allow the structure to change more easily. This structure is disposed by calling mamaPublisherCallbacks_deallocate.
MAMAExpDLL mama_status mamaPublisherCallbacks_deallocate(
mamaPublisherCallbacks * cb
)
Parameters:
Deallocate a publisher events callback structure. This structure was obtained by calling mamaPublisherCallbacks_allocate.
MAMAExpDLL mama_status mamaPublisher_getUserCallbacks(
mamaPublisher publisher,
mamaPublisherCallbacks * cb
)
Parameters:
Retrieve the publisher callbacks.
MAMAExpDLL mama_status mamaPublisher_getState(
mamaPublisher publisher,
mamaPublisherState * state
)
MAMAExpDLL const char * mamaPublisher_stringForState(
mamaPublisherState state
)
MAMAExpDLL mama_status mamaPublisher_getRoot(
mamaPublisher publisher,
const char ** root
)
MAMAExpDLL mama_status mamaPublisher_getSource(
mamaPublisher publisher,
const char ** source
)
MAMAExpDLL mama_status mamaPublisher_getSymbol(
mamaPublisher publisher,
const char ** symbol
)
/* $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 MamaPublisherH__
#define MamaPublisherH__
#if defined( __cplusplus )
extern "C"
{
#endif /* defined( __cplusplus ) */
typedef enum
{
MAMA_PUBLISHER_UNKNOWN = 0,
MAMA_PUBLISHER_CREATING = 1,
MAMA_PUBLISHER_LIVE = 2,
/* The publisher is being destroyed. */
MAMA_PUBLISHER_DESTROYING = 3,
/* The publisher is being destroyed and the bridge has sent onDestroy. */
MAMA_PUBLISHER_DESTROYED_BRIDGE = 4,
/* The publisher is being destroyed and waiting on the bridge's onDestroy. */
MAMA_PUBLISHER_DESTROYING_WAIT_BRIDGE = 5,
/* The publisher has been fully destroyed. */
MAMA_PUBLISHER_DESTROYED = 6
} mamaPublisherState;
typedef void (MAMACALLTYPE *mamaThrottledSendCompleteCb) (
mamaPublisher publisher,
mamaMsg msg,
mama_status status,
void* closure);
typedef void (MAMACALLTYPE *mama_publisherOnCreateCb) (
mamaPublisher publisher,
void* closure);
typedef void (MAMACALLTYPE *mama_publisherOnDestroyCb) (
mamaPublisher publisher,
void* closure);
typedef void (MAMACALLTYPE *mama_publisherOnErrorCb) (
mamaPublisher publisher,
mama_status status,
const char* info,
void* closure);
typedef void (MAMACALLTYPE *mama_publisherOnSuccessCb) (
mamaPublisher publisher,
mama_status status,
const char* info,
void* closure);
typedef struct mamaPublisherCallbacks
{
mama_publisherOnCreateCb onCreate;
mama_publisherOnErrorCb onError;
mama_publisherOnDestroyCb onDestroy;
mama_publisherOnSuccessCb onSuccess;
} mamaPublisherCallbacks;
MAMAExpDLL
extern mama_status
mamaPublisher_create (mamaPublisher* result,
mamaTransport tport,
const char* symbol,
const char* source,
const char* root);
MAMAExpDLL
extern mama_status
mamaPublisher_createWithCallbacks (
mamaPublisher* result,
mamaTransport tport,
mamaQueue queue,
const char* symbol,
const char* source,
const char* root,
mamaPublisherCallbacks* cb,
void* closure);
MAMAExpDLL
extern mama_status
mamaPublisher_send (mamaPublisher publisher,
mamaMsg msg);
MAMAExpDLL
extern mama_status
mamaPublisher_sendWithThrottle (mamaPublisher publisher,
mamaMsg msg,
mamaThrottledSendCompleteCb sendCompleteCb,
void* closure);
/*
* Send a p2p message from the specified inbox using the throttle.
* The lifecycle of the message sent is controlled by the user of the API. The
* callback indicates when the API is no longer using the message and can be
* destroyed/reused by the application.
*
* @param publisher The mamaPublisher from which to send the message.
* @param inbox The mamaInbox which will process any response to the sent message.
* @param msg The mamaMsg to send.
* @param sendCompleteCb The callback which will be invoked when the message
* is sent from the throttle queue.
* @param closure User supplied data returned when the callback is invoked.
*/
MAMAExpDLL
extern mama_status
mamaPublisher_sendFromInboxWithThrottle (mamaPublisher publisher,
mamaInbox inbox,
mamaMsg msg,
mamaThrottledSendCompleteCb sendCompleteCb,
void* closure);
/*
* Send a p2p message from the specified inbox.
*
* @param publisher The mamaPublisher from which to send the message
* @param inbox The mamaInbox which will process any response to the sent
* message.
* @param msg The mamaMsg to send.
*/
MAMAExpDLL
extern mama_status
mamaPublisher_sendFromInbox (mamaPublisher publisher,
mamaInbox inbox,
mamaMsg msg);
MAMAExpDLL
extern mama_status
mamaPublisher_sendReplyToInboxHandle (mamaPublisher publisher,
mamaMsgReply replyAddress,
mamaMsg reply);
MAMAExpDLL
extern mama_status
mamaPublisher_sendReplyToInbox (mamaPublisher publisher,
mamaMsg request,
mamaMsg reply);
MAMAExpDLL
extern mama_status
mamaPublisher_destroy (mamaPublisher publisher);
MAMAExpDLL
extern mama_status
mamaPublisher_destroyEx(mamaPublisher publisher);
MAMAExpDLL
extern mama_status
mamaPublisher_getTransport (mamaPublisher publisher,
mamaTransport* transport);
MAMAExpDLL
extern mama_status
mamaPublisherCallbacks_allocate (mamaPublisherCallbacks** cb);
MAMAExpDLL
extern mama_status
mamaPublisherCallbacks_deallocate (mamaPublisherCallbacks* cb);
MAMAExpDLL
extern mama_status
mamaPublisher_getUserCallbacks (mamaPublisher publisher,
mamaPublisherCallbacks* cb);
MAMAExpDLL
extern mama_status
mamaPublisher_getState (mamaPublisher publisher,
mamaPublisherState* state);
MAMAExpDLL
extern const char*
mamaPublisher_stringForState (mamaPublisherState state);
MAMAExpDLL
extern mama_status
mamaPublisher_getRoot (mamaPublisher publisher, const char** root);
MAMAExpDLL
extern mama_status
mamaPublisher_getSource (mamaPublisher publisher, const char** source);
MAMAExpDLL
extern mama_status
mamaPublisher_getSymbol (mamaPublisher publisher, const char** symbol);
#if defined( __cplusplus )
}
#endif /* defined( __cplusplus ) */
#endif /* MamaPublisherH__ */
Updated on 2023-03-31 at 15:29:16 +0100