Refinitiv Data Library for Python

stream.on_refresh

Called every time the whole fields list of a requested instrument is received from the platform.

Module

refinitiv.data.content.pricing

Syntax

stream.on_refresh(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 refreshed by the platform or it was opened successfully:

import datetime

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

definition = pricing.Definition("EUR=")
stream = definition.get_stream()
stream.on_refresh(display_refresh)
stream.open()

None