The basic subscription supports publish / subscribe. This class can be disposed or the deallocate function called to reduce time during finalization. Note that the deallocate function will attempt to destroy the subscription if this has not already been done whereas dispose will only de-allocate the memory.
Inherits from Wombat.MamaWrapper, IDisposable
Inherited by Wombat.MamaSubscription
Name | |
---|---|
class | MamaBasicSubscriptionImpl This impl will perform the work of invoking user supplied callbacks, it is held to ensure that the user can destroy and recreate the parent subscription during the callbacks. |
struct | NativeMethods |
Name | |
---|---|
delegate void | OnSubscriptionCreateDelegate(IntPtr nativeHandle, IntPtr closure) This delegate describes that native callback function that is invoked whenever the subscription has been created. |
delegate void | OnSubscriptionDestroyDelegate(IntPtr nativeHandle, IntPtr closure) This delegate describes the native function invoked whenever the subscription has been either destroyed or deactivated. |
delegate void | OnSubscriptionErrorDelegate(IntPtr nativeHandle, int status, IntPtr platformError, string subject, IntPtr closure) This delegate describes the native function invoked if an error occurs during prior to subscription creation or if the subscription receives a message for an un-entitled subject. If the status is MAMA_MSG_STATUS_NOT_ENTITTLED the subject parameter is the specific unentitled subject. If the subscription subject contains wildcards, the subscription may still receive messages for other entitled subjects. Note wildcard subscriptions are not supported on all platforms. |
delegate void | OnSubscriptionGapDelegate(IntPtr nativeHandle, IntPtr closure) This delegate describes the native function invoked when a sequence number gap is detected. At this point the topic is considered stale and the subscription will not receive further messages until the feed handler satisfies a recap request. |
delegate void | OnSubscriptionMessageDelegate(IntPtr nativeHandle, IntPtr msg, IntPtr closure, IntPtr itemClosure) This delegate describes the native function that is invoked whenever a message arrives. |
delegate void | OnSubscriptionQualityDelegate(IntPtr nativeHandle, int quality, string symbol, short cause, string platforminfo, IntPtr closure) This delegate describes the native function invoked to indicate a data quality event. |
delegate void | OnSubscriptionRecapRequestDelegate(IntPtr nativeHandle, IntPtr closure) This delegate describes the native function invoked when a recap is requested upon detecting a sequence number gap. |
MamaBasicSubscription() Constructor constructs a new basic subscription including creating the underlying native subscription. |
|
void | createBasic(MamaTransport transport, MamaQueue queue, MamaBasicSubscriptionCallback callback, string symbol) This function will create the basic subscription without marketdata semantics. To pass a closure use the overload. |
void | createBasic(MamaTransport transport, MamaQueue queue, MamaBasicSubscriptionCallback callback, string symbol, object closure) This function will create the basic subscription without marketdata semantics. |
void | deallocate() Free the memory for a mamaSubscription which was allocated via a call to constructor. This function will call destroy() if the subscription has not already been destroyed. Calling this function will reduce time during finalization. |
void | destroy() This function will destroy the subscription, it must be called from the same thread that is processing the queue for the subscription. Use destroyEx to destroy the subscription from any thread. Note that the subscription will not be fully destroyed until the onDestroy callback is received. |
void | destroyEx() Destroy the subscription. This function is another option to destroy the resources associated with the subscription It will schedule the destroy() of the subscription on the queue on which it dispatches. This function does not free the memory associated with the subscription. create() can be called again after this function has been called. After the Subscription is effectively destroyed, the OnDestroy callback will be triggered for it. |
Name | |
---|---|
virtual override MamaStatus.mamaStatus | DestroyNativePeer() This will be called by the base class to de-allocate the native subscription. MamaWrapper.DestroyNativePeer |
Name | |
---|---|
mamaSubscriptionState | State This read only property returns the current state of the subscription, this function should be used in preference to the mamaSubscription_isActive or mamaSubscription_isValid functions. function is thread-safe. The state will be one of the mamaSubscriptionState enumeration values. |
object | subscClosure Read only property returns the closure passed to the create function. |
MamaQueue | subscQueue Read only property returns the queue. |
string | subscSymbol Read only property returns the symbol for this subscription. |
Name | |
---|---|
object | mClosure The closure passed to the create function. This member is declared as protected as there is a public read only property to access it. |
MamaQueue | mQueue The queue passed to the create function. This member is declared as protected as there is a public read only property to access it. |
MamaTransport | mTransport The transport passed to the create function. This member is declared as protected as there is a public read only property to access it. |
NativeMethods.SubscriptionCallbacks | mCallbackDelegates This structure holds all of the callback delegates, it is initialised in the static constructor. |
Public Functions inherited from Wombat.MamaWrapper
Name | |
---|---|
void | Dispose() Destroys the underlying peer object and unbinds the wrapper from it. |
void | setNativeHandle(IntPtr nHandle) Sets the native handle of the native peer object. Should only be used by subclasses and in the same assembly. |
Protected Functions inherited from Wombat.MamaWrapper
Name | |
---|---|
MamaWrapper() Constructs a new wrapper object but doesn’t create it. If the object is not explicitly disposed it will remain registered for finalization and will attempt the destroy the native peer object when finalized. |
|
MamaWrapper(IntPtr nativeHandle) Constructs a managed wrapper from an existing native peer. The peer object will not be automatically finalized |
|
virtual void | Dispose(bool disposing, bool destroyNativeHandle =true) The actual implementation of Dispose - called by both the Dispose method and the finalizer. |
virtual void | OnDispose() |
Protected Attributes inherited from Wombat.MamaWrapper
Name | |
---|---|
IntPtr | nativeHandle the handle to the native peer object |
delegate void OnSubscriptionCreateDelegate(
IntPtr nativeHandle,
IntPtr closure
)
This delegate describes that native callback function that is invoked whenever the subscription has been created.
Parameters:
delegate void OnSubscriptionDestroyDelegate(
IntPtr nativeHandle,
IntPtr closure
)
This delegate describes the native function invoked whenever the subscription has been either destroyed or deactivated.
Parameters:
delegate void OnSubscriptionErrorDelegate(
IntPtr nativeHandle,
int status,
IntPtr platformError,
string subject,
IntPtr closure
)
This delegate describes the native function invoked if an error occurs during prior to subscription creation or if the subscription receives a message for an un-entitled subject. If the status is MAMA_MSG_STATUS_NOT_ENTITTLED the subject parameter is the specific unentitled subject. If the subscription subject contains wildcards, the subscription may still receive messages for other entitled subjects. Note wildcard subscriptions are not supported on all platforms.
Parameters:
delegate void OnSubscriptionGapDelegate(
IntPtr nativeHandle,
IntPtr closure
)
This delegate describes the native function invoked when a sequence number gap is detected. At this point the topic is considered stale and the subscription will not receive further messages until the feed handler satisfies a recap request.
Parameters:
delegate void OnSubscriptionMessageDelegate(
IntPtr nativeHandle,
IntPtr msg,
IntPtr closure,
IntPtr itemClosure
)
This delegate describes the native function that is invoked whenever a message arrives.
Parameters:
delegate void OnSubscriptionQualityDelegate(
IntPtr nativeHandle,
int quality,
string symbol,
short cause,
string platforminfo,
IntPtr closure
)
This delegate describes the native function invoked to indicate a data quality event.
Parameters:
delegate void OnSubscriptionRecapRequestDelegate(
IntPtr nativeHandle,
IntPtr closure
)
This delegate describes the native function invoked when a recap is requested upon detecting a sequence number gap.
Parameters:
MamaBasicSubscription()
Constructor constructs a new basic subscription including creating the underlying native subscription.
void createBasic(
MamaTransport transport,
MamaQueue queue,
MamaBasicSubscriptionCallback callback,
string symbol
)
This function will create the basic subscription without marketdata semantics. To pass a closure use the overload.
Parameters:
void createBasic(
MamaTransport transport,
MamaQueue queue,
MamaBasicSubscriptionCallback callback,
string symbol,
object closure
)
This function will create the basic subscription without marketdata semantics.
Parameters:
void deallocate()
Free the memory for a mamaSubscription which was allocated via a call to constructor. This function will call destroy() if the subscription has not already been destroyed. Calling this function will reduce time during finalization.
void destroy()
This function will destroy the subscription, it must be called from the same thread that is processing the queue for the subscription. Use destroyEx to destroy the subscription from any thread. Note that the subscription will not be fully destroyed until the onDestroy callback is received.
void destroyEx()
Destroy the subscription. This function is another option to destroy the resources associated with the subscription It will schedule the destroy() of the subscription on the queue on which it dispatches. This function does not free the memory associated with the subscription. create() can be called again after this function has been called. After the Subscription is effectively destroyed, the OnDestroy callback will be triggered for it.
This function can be called from any thread, as opposed to destroy().
virtual override MamaStatus.mamaStatus DestroyNativePeer()
This will be called by the base class to de-allocate the native subscription. MamaWrapper.DestroyNativePeer
Return: MAMA Status code.
Reimplements: Wombat::MamaWrapper::DestroyNativePeer
mamaSubscriptionState State;
This read only property returns the current state of the subscription, this function should be used in preference to the mamaSubscription_isActive or mamaSubscription_isValid functions. function is thread-safe. The state will be one of the mamaSubscriptionState enumeration values.
object subscClosure;
Read only property returns the closure passed to the create function.
MamaQueue subscQueue;
Read only property returns the queue.
string subscSymbol;
Read only property returns the symbol for this subscription.
object mClosure;
The closure passed to the create function. This member is declared as protected as there is a public read only property to access it.
MamaQueue mQueue;
The queue passed to the create function. This member is declared as protected as there is a public read only property to access it.
MamaTransport mTransport;
The transport passed to the create function. This member is declared as protected as there is a public read only property to access it.
static NativeMethods.SubscriptionCallbacks mCallbackDelegates;
This structure holds all of the callback delegates, it is initialised in the static constructor.
Updated on 2023-03-31 at 15:29:32 +0100