DataSource for C SDK  6.2.20.310828
Deprecated: The Active Cache

Functions

void ds_cache_add_object (char *subject)
 Add a new object to the cache. More...
 

Detailed Description

The Active Cache enables a broadcast-style data feed to be turned into an acitive request-based one. This is done by caching all data in DataSource and handling requests for that data internally.

Active Cache allows a DataSource programmer to send data in a simple way instead of having to write a database or caching mechanism. Handling active requests and keeping track of what objects are being viewed is all handled by the DataSource library.

This feature is useful when one DataSource is feeding multiple DataSource peers and the peers are only interested in a small subset of the overall data.

A second use of the Active Cache is to allow an active DataSource to provide a pre-caching mechanism. In this scenario, the DataSource should read a watchlist, request these symbols from the feed and then broadcast updates into the Active Cache.

When a peer requests objects which are within the cache the request is met by the DataSource libraries, if the object is not available within the cache then the DataSource's recv_request_t callback is called and the DataSource can service the request as usual.

See also
ds_set_status_up()
ds_set_status_down()
Note
The active cache is only available when the DSv5 API is not being used.
If the active cache is used then ds_send_data() should only be called on the main DataSource thread.

Function Documentation

void ds_cache_add_object ( char *  subject)

Add a new object to the cache.

Parameters
subjectSymbol to add to the active cache

Add a new placemarker to the active cache. This is required in case a request comes in for an object before the cache has a value for it. A subscription for that peer is noted but no data sent until an update is received from the DataSource.

This means that the Liberator configuration option active-request-timeout must be greater than the total amount of time that it takes for all objects to come back from the datafeed.


Generated on Wed Jan 24 2018 12:22:46 for DataSource for C SDK