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.

<AHS>

The Jira EAPI-4508 is closed. I have tested the https://pypi.org/project/refinitiv-data/ version 1.0.0b24. I found that the issue is persisting. The library tries to reconnect to the WebSocket 5, 10, 15 sec, then 60 seconds endlessly.

I have ping the RD team in the Jira.

Hi @tino.chow ,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

@tino.chow

Hi,

Please let us know if you have any updates on this question.

If it is still an issue, please post again to offer further insight into your question.

Regards,

AHS

Upvote
Accepted
24.7k 54 17 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 40 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.