Refinitiv Data Library for Python

stream.on_update

Called when some fields of one of the requested instruments are updated.

Module

refinitiv.data.content.pricing

Syntax

stream.on_update(func)

Parameters

Value Description Data type Optional Default value
func Callable object to process the retrieved data. Callable No -

Returned value

pricing.Stream object

Usage

The following example demonstrates how to display messages received when the stream is updated:

import datetime


# previously defined callable, pay attention that arguments order is important
def display_update(fields, instrument_name, pricing_stream):
    current_time = datetime.datetime.now().time()
    print("\t{} | Receive update [{}] : {}".format(current_time, instrument_name, fields))  # noqa


definition = pricing.Definition("EUR=")
stream = definition.get_stream()
stream.on_update(display_update)
stream.open()

None.