Skip to content
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

Add Driver.disconnect function #80

Merged
merged 6 commits into from
Mar 21, 2021
Merged

Add Driver.disconnect function #80

merged 6 commits into from
Mar 21, 2021

Conversation

jneeven
Copy link
Contributor

@jneeven jneeven commented Mar 21, 2021

Since Driver.init_websocket starts an infinite loop, there is currently no way to cleanly shutdown the driver. This PR adds a self._alive flag that can be toggled with a disconnect function to break out of the event loop.

@jneeven
Copy link
Contributor Author

jneeven commented Mar 21, 2021

I'm not sure what these linting errors are about, I haven't even touched that file...

@Vaelor
Copy link
Owner

Vaelor commented Mar 21, 2021

Yeah thats an issue on my end.
Thanks for your PR this makes a lot of sense! :)

@Vaelor Vaelor merged commit 8c7779b into Vaelor:master Mar 21, 2021
@Vaelor
Copy link
Owner

Vaelor commented Mar 21, 2021

FYI I added the self._alive to another while loop, since I observed that it would only disconnect after a message was received and I felt like it should disconnect as soon as possible.

@jneeven
Copy link
Contributor Author

jneeven commented Mar 21, 2021

FYI I added the self._alive to another while loop, since I observed that it would only disconnect after a message was received and I felt like it should disconnect as soon as possible.

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants