Classes Files

Wombat::MamaResourcePool

A MamaResourcePool is a convenience wrapper to allow easy subscription and management of OpenMAMA related resources

Public Functions

  Name
void destroy()
MamaSubscription createSubscriptionFromUri(string uri, MamaSubscriptionCallback callbacks, object closure)
MamaSubscription createSubscriptionFromComponents(string transportName, string sourceName, string topicName, MamaSubscriptionCallback callbacks, object closure)
MamaSubscription createSubscriptionFromTopicWithSource(string sourceName, string topicName, MamaSubscriptionCallback callbacks, object closure)
MamaSubscription createSubscriptionFromTopic(string topicName, MamaSubscriptionCallback callbacks, object closure)
MamaTransport createTransportFromName(string transportName)
void destroySubscription(MamaSubscription subscription)
  MamaResourcePool(string name)

Public Functions Documentation

function destroy

void destroy()

Destroys a MAMA resource pool and all subscriptions, transports etc that were created using it.

function createSubscriptionFromUri

MamaSubscription createSubscriptionFromUri(
    string uri,
    MamaSubscriptionCallback callbacks,
    object closure
)

Parameters:

  • uri A url string in “bridge://transport/source/topic?param=1” format
  • callbacks A list of mama message callbacks to invoke during the subscription’s life cycle
  • closure An opaque object to point to your callbacks

Return: A pointer to a mama subscription object, or NULL on failure

Creates a MAMA Subscription using the given uri which is expected to be a null terminated string in “bridge://transport/source/topic?param=1” format.

function createSubscriptionFromComponents

MamaSubscription createSubscriptionFromComponents(
    string transportName,
    string sourceName,
    string topicName,
    MamaSubscriptionCallback callbacks,
    object closure
)

Parameters:

  • transportName The name of the transport to use. If it has not yet been used, it will be created in the process here.
  • sourceName The name of the source to use. If it has not yet been used, it will be created in the process here.
  • topicName The name of the source to use. If it has not yet been used, it will be created in the process here.
  • callbacks A list of mama message callbacks to invoke during the subscription’s life cycle
  • closure An opaque object to point to your callbacks

Return: A pointer to a mama subscription object, or NULL on failure

Creates a MAMA Subscription using the given components which are referenced by name.

function createSubscriptionFromTopicWithSource

MamaSubscription createSubscriptionFromTopicWithSource(
    string sourceName,
    string topicName,
    MamaSubscriptionCallback callbacks,
    object closure
)

Parameters:

  • sourceName The name of the source to use. If it has not yet been used, it will be created in the process here.
  • topicName The name of the source to use. If it has not yet been used, it will be created in the process here.
  • callbacks A list of mama message callbacks to invoke during the subscription’s life cycle
  • closure An opaque object to point to your callbacks

Return: A pointer to a mama subscription object, or NULL on failure

Creates a MAMA Subscription using the given topic and source and the default resource pool’s subscribing transport (default_transport_sub).

function createSubscriptionFromTopic

MamaSubscription createSubscriptionFromTopic(
    string topicName,
    MamaSubscriptionCallback callbacks,
    object closure
)

Parameters:

  • topicName The name of the source to use. If it has not yet been used, it will be created in the process here.
  • callbacks A list of mama message callbacks to invoke during the subscription’s life cycle
  • closure An opaque object to point to your callbacks

Return: A pointer to a mama subscription object, or NULL on failure

Creates a MAMA Subscription using the given topic the default resource pool’s subscribing source (default_source_sub).

function createTransportFromName

MamaTransport createTransportFromName(
    string transportName
)

Parameters:

  • topicName The name of the source to use. If it has not yet been used, it will be created in the process here.
  • callbacks A list of mama message callbacks to invoke during the subscription’s life cycle
  • closure An opaque object to point to your callbacks

Return: A pointer to a mama subscription object, or NULL on failure

Creates a MAMA Subscription using the given topic the default resource pool’s subscribing source (default_source_sub).

function destroySubscription

void destroySubscription(
    MamaSubscription subscription
)

Parameters:

  • subscription The subscription to destroy

Destroys the given subscription and removes it from the resource pool asynchronously. There may be further callbacks after calling this function since this event is enqueued on the subscription’s thread, so for any closure related shutdown code, cleanup should be performed in the subscription’s onDestroy callback.

function MamaResourcePool

MamaResourcePool(
    string name
)

Parameters:

  • name The name of the MAMA resource pool in configuration

Creates a MAMA resource pool to manage subscription lifecycles on behalf of the application calling it.


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