-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When "agg_trade" is running, I can't terminate the program using Ctrl+C. Is there any solution to this? #345
Comments
Have you considered closing the connection using the method |
Yes, I know about my_client.stop(), but what I want is for the program to keep running until I manually close it, not to stop automatically after a set time. How can I make it so that I can decide whether it should close at any time after the program starts running? @alplabin |
What exactly happens when you Ctrl+c? Which os are you using? |
I run the program in the terminal of VSCode on Windows. After pressing Ctrl+c, the program continues its previous running state, constantly fetching the latest data from a remote server and printing the data on the screen. This terminal cannot respond to any other operations. @alplabin This is my code:
|
from binance.websocket.spot.websocket_stream import SpotWebsocketStreamClient
def on_message(_, _message):
print(_message)
my_client = SpotWebsocketStreamClient(on_message=on_message)
my_client.agg_trade(symbol="btcusdt")
The text was updated successfully, but these errors were encountered: