Class: DataProvider

lightstreamer-adapter/dataprovider~ DataProvider

new DataProvider

Data provider constructor.
This object extends the EventEmitter object and emits the following events:
  • subscribe: function(itemName, response) {}
  • unsubscribe: function(itemName, response) {}
The response argument is a DataResponse object and one of its methods, error or success, must be called in order to reply to the request bound to the event.
Parameters:
Name Type Argument Description
reqRespStream Stream the request/reply stream channel to the remote LS proxy adapter
notifyStream Stream the asynchronous stream channel to the remote LS proxy adapter
isSnapshotAvailable Function <optional>
optional callback the receive an itemName as argument and must return a boolean value asserting if the iteam supports snapshot. The default value is function(itemName) {return false;}

Method Summary

endOfSnapshot
Sends an end of snapshot message for a particular item to the remote LS proxy.
failure
Sends a failure message to the remote LS proxy.
getNotifyStream
Returns the configured notify stream.
getReqRespStream
Returns the configured request/reply stream.
update
Sends an update for a particular item to the remote LS proxy.

Method Detail

<inner> endOfSnapshot

Sends an end of snapshot message for a particular item to the remote LS proxy.
Parameters:
Name Type Description
itemName String the item name

<inner> failure

Sends a failure message to the remote LS proxy.
Parameters:
Name Type Description
exception String the exception message

<inner> getNotifyStream

Returns the configured notify stream.
Returns:
Object the stream

<inner> getReqRespStream

Returns the configured request/reply stream.
Returns:
Object the stream

<inner> update

Sends an update for a particular item to the remote LS proxy.
Parameters:
Name Type Description
itemName String the item name
isSnapshot Boolean is it a snapshot?
data Object an associative array of strings that represents the data to be published