InstrumentDataSubscriber
instances are responsible for receiving asynchronous instrument
data streams from some publisher (the server) and forwarding them to a trade leg that is connected with
that instrument. The InstrumentDataSubscriber
interface exists to decouple the details of
the data transfer protocol away from the trade model. An InstrumentDataSubscriber
only
provides data for a single instrument, to a single trade leg (at any one time).
Methods
subscribe Trade Leg(trade Leg, instrument Name, field Names)
Registers a trade leg to receive data for a particular instrument.
Parameters:
Name | Type | Description |
---|---|---|
tradeLeg |
module:ct-trading |
The trade leg that will receive the data. |
instrumentName |
String | The name of the financial instrument for which the leg requires data. |
fieldNames |
Array | The list of fields for which the leg requires data. |
unsubscribe Trade Leg()
Deallocates any resources used by the subscriber.
Correctly implementing this method is important, since if users are not un-subscribed for instruments they are no longer viewing, then serious performance problems are likely to occur.