question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BinanceWebSocketApiManager.stop_stream() doesn't stop the stream immediately

See original GitHub issue

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

  • I have searched for other issues with the same problem or similar feature requests.

Select one:

  • Bug
  • Feature Request
  • Technical Help
  • Other

Environment

  • Are you using the module on a VPS or other Cloud hosting?
  • Are you using the module on a Raspberry Pi?

What kind of internet connection do you have?

cable

Average system load (CPU)

%10

Hardware specification

Operating System? (include version)

  • macOS
  • Windows
  • Linux (include flavour)

Options

  • stream_buffer
  • process_stream_data

Which endpoint do you connect?

 binance.com

Python Version Requirement

  • I am using Python 3.6.1 or above

Exact Python Version?

Python 3.8.1

Pip Version?

pip 21.0.1

Dependencies

UNICORN Binance WebSocket API Version?

1.29.0

Description of your issue

stop_stream() doesn’t stop the related stream immediately. As we can see the code just stops restart.

https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/c975d49486f93761bbeb01e5a87ff9d4302129f6/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py#L3171

So we need to wait till next heartbeat/ping-pong. Maybe this is the design choice but the function name is a little bit confusing then. Maybe we rename it to: stop_restart_stream()? Or we can implement delete_listen_key_by_stream_id() as well as delete_stream_from_stream_list in it? Maybe both? Just a suggestion.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
oliver-zehentleitnercommented, Apr 7, 2021
0reactions
oliver-zehentleitnercommented, Mar 10, 2022

@ebp-z thanks for the hint. using wait_for() has led to restart of the socket after each timeout. i tested wit loop.run_until_complete() and loop.run_forever().

But i found out now, that the loop.stop() which i tryed in the past, is working with loop.run_forever() but not with loop.run_until_complete() what we used till now. i switched it and stop() works now 😃

Thanks you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop stream | Stopstream.co | Watch Free Sports
STOP STREAM - Watch Sports events on StopStream, we broadcasts from other website like usagoals TV, vipbox, drakulastream, fromhot and provide free online...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found