Refinitiv Data Library for Python

stream.on_status

Called when a status is received for one of the requested instruments.

Module

refinitiv.data.content.pricing

Syntax

stream.on_status(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 status is successfully received:

import datetime


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


definition = pricing.Definition("EUR=")
stream = definition.get_stream()
stream.on_status(display_status)
stream.open()

None.