-
Notifications
You must be signed in to change notification settings - Fork 50
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
Socket mode in a tokio task breaks on Ctrl-C. #231
Comments
Hey,
|
Oh I just wanted to run it in main, and hit Thing is, I also run a client/listener for a discord bot in the same app, so at least one of those 2 Sending a |
Yeah, as I suspected you have other stuff to run and await :)
|
The nature of an error is coming from the ctrlc implementation:
I suspect someone else already set it. I don't have a windows machine to debug it more, so if you are able to find a better implementation for windows, let me know :) |
Ahh, thank you, your example actually makes the api a lot clearer. I (wasn't awake enough and) didn't read hard enough into it, so I had assumed I would've needed to setup events to send signals or some such, but it's just two split calls - appreciate it! My qualms have been resolved (Thanks!), so I'll let you handle closing the issue in the hopes that a good ctrl-c lib that fixes this comes along ? |
Well, if it works for you, then I'll close this issue, since as I mentioned, |
Putting
socket_mode_listener.serve().await;
into atokio::spawn(async move { ... })
, then hittingCtrl-C
makes tokio panic withThis is on Windows with PowerShell.
Letting the socket sit in actual
main
and hittingCtrl-C
there works just fine, thankfully.The text was updated successfully, but these errors were encountered: