A MamdaSubscription is used to register interest in a particular symbol and source. A MamaTransport is required to actually activate the subscription. More…
Inherits from Wombat.MamdaResourceContainer, IDisposable
Name | |
---|---|
MamdaSubscription() Default constructor. The subscription is not created until either create() or activate() is called. |
|
void | create(MamaTransport transport, MamaQueue queue, string source, string symbol, object closure) Create and activate a subscription. Any properties for the subscription should be set prior to calling this method. |
void | setSource(string source) Set the data source name. Do this before calling activate(). |
void | setSymbol(string symbol) Set the symbol. Do this before calling activate(). |
void | setTransport(MamaTransport transport) Set the MAMA transport. Do this before calling activate(). |
void | setQueue(MamaQueue queue) Set the MAMA queue. Do this before calling activate(). |
void | setType(mamaSubscriptionType type) Set the subscrption type. Do this before calling activate() Default is |
void | setServiceLevel(mamaServiceLevel serviceLevel, int serviceLevelOpt) Set the MAMA service level. In the future, certain service levels may have an optional argument (e.g., an interval for conflated data). Do this before calling activate(). Default value is |
void | setRequireInitial(bool require) Set whether an initial value is required. Do this before calling activate(). Default is |
void | setTimeout(double timeout) Set the timeout (in seconds) for this subscription. Do this before calling activate(). Default is 10 seconds. |
void | setRetries(int retries) Set the retries for this subscription. Do this before calling activate(). Default is 10 seconds. |
void | setClosure(Object closure) Set the closure. Do this before calling activate(). |
void | addMsgListener(MamdaMsgListener listener) Add a listener for regular messages. |
ArrayList | getMsgListeners() get a listener for regular messages. |
void | addStaleListener(MamdaStaleListener listener) Add a listener for changes in stale status. |
void | addErrorListener(MamdaErrorListener listener) Add a listener for error events. |
void | activate() Activate the subscription. Until this method is invoked, no updates will be received. |
void | deactivate() Deactivate the subscription. No more updates will be received for this subscription (unless activate() is invoked again). |
void | requestRecap() Force a recap request to be sent for this subscription. |
string | getSource() |
double | getTimout() |
int | getRetries() |
string | getSymbol() |
MamaQueue | getQueue() |
MamaTransport | getTransport() |
Object | getClosure() Get the additional object passed as the closure to the create() method. |
MamaSubscription | getMamaSubscription() |
Public Functions inherited from Wombat.MamdaResourceContainer
Name | |
---|---|
void | Dispose() Destroys the resources |
Protected Functions inherited from Wombat.MamdaResourceContainer
Name | |
---|---|
MamdaResourceContainer() | |
void | AddResource(IDisposable resource) |
class Wombat::MamdaSubscription;
A MamdaSubscription is used to register interest in a particular symbol and source. A MamaTransport is required to actually activate the subscription.
Multiple listeners can be added to the MamdaSubscription. In this way, an application can make use of more than one of the specialized value added MAMDA listeners, such as MamdaTradeListener and MamdaQuoteListener.
MamdaSubscription()
Default constructor. The subscription is not created until either create() or activate() is called.
void create(
MamaTransport transport,
MamaQueue queue,
string source,
string symbol,
object closure
)
Create and activate a subscription. Any properties for the subscription should be set prior to calling this method.
Parameters:
void setSource(
string source
)
Set the data source name. Do this before calling activate().
Parameters:
void setSymbol(
string symbol
)
Set the symbol. Do this before calling activate().
Parameters:
void setTransport(
MamaTransport transport
)
Set the MAMA transport. Do this before calling activate().
Parameters:
void setQueue(
MamaQueue queue
)
Set the MAMA queue. Do this before calling activate().
Parameters:
void setType(
mamaSubscriptionType type
)
Set the subscrption type. Do this before calling activate() Default is
Parameters:
mamaSubscriptionType.MAMA_SUBSC_TYPE_NORMAL
void setServiceLevel(
mamaServiceLevel serviceLevel,
int serviceLevelOpt
)
Set the MAMA service level. In the future, certain service levels may have an optional argument (e.g., an interval for conflated data). Do this before calling activate(). Default value is
Parameters:
MamaServiceLevel.MAMA_SERVICE_LEVEL_REAL_TIME
and 0
void setRequireInitial(
bool require
)
Set whether an initial value is required. Do this before calling activate(). Default is
Parameters:
true
void setTimeout(
double timeout
)
Set the timeout (in seconds) for this subscription. Do this before calling activate(). Default is 10 seconds.
Parameters:
void setRetries(
int retries
)
Set the retries for this subscription. Do this before calling activate(). Default is 10 seconds.
Parameters:
void setClosure(
Object closure
)
Set the closure. Do this before calling activate().
Parameters:
void addMsgListener(
MamdaMsgListener listener
)
Add a listener for regular messages.
Parameters:
ArrayList getMsgListeners()
get a listener for regular messages.
void addStaleListener(
MamdaStaleListener listener
)
Add a listener for changes in stale status.
Parameters:
void addErrorListener(
MamdaErrorListener listener
)
Add a listener for error events.
Parameters:
void activate()
Activate the subscription. Until this method is invoked, no updates will be received.
void deactivate()
Deactivate the subscription. No more updates will be received for this subscription (unless activate() is invoked again).
This function must be called from the same thread dispatching on the associated event queue unless both the default queue and dispatch queue are not actively dispatching.
void requestRecap()
Force a recap request to be sent for this subscription.
Note: there is still a possibility that the feed handler will reject such recap requests (based on configurable feature(s) of a feed handler).
string getSource()
Return:
double getTimout()
Return:
int getRetries()
Return:
string getSymbol()
Return:
MamaQueue getQueue()
Return:
MamaTransport getTransport()
Return:
Object getClosure()
Get the additional object passed as the closure to the create() method.
Return:
MamaSubscription getMamaSubscription()
Updated on 2023-03-31 at 15:30:14 +0100