question

Upvotes
Accepted
3 0 0 4

How to stop Python Data library from retrying connection

I am testing the new python api to connect to a deployed TREP server.

https://developers.refinitiv.com/en/api-catalog/refinitiv-data-platform/refinitiv-data-library-for-python

And I follow this example to open a streaming to retrieve live prices.

https://github.com/Refinitiv-API-Samples/Example.DataLibrary.Python/blob/main/Tutorials/2.Content/2.2-Pricing/TUT_2.2.02-Pricing-StreamingCache.ipynb

What I found is if I provide incorrect username, the stream will keep retrying and never terminate the thread.

the session.stream_auto_reconnection is hardcoded to True and cannot be configured.

calling stream.close() also raise error "AttributeError: 'NoneType' object has no attribute 'remove_listener'". I guess it is because stream is pending to be opened, so you cant really close it.


What should I do to stop stream from reconnecting or to terminate it?

python#technology#productpython apistreaming-data
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
28k 68 18 14

Hello @tino.chow

Sorry for the late response. The RD Library team informs that the issue is addressed in refinitiv-data version 1.0.0b25.

Hope this helps.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
32.2k 41 11 20

Hello @tino.chow ,

Thanks for letting us know.

I see the same and I have contacted RD Library experts for a clarification.

We will update this question.

Thanks for your patience.

-AHS

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi, is there any updates on this?

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.