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

Is there anyway to programically quit application? #4

Open
ForceConstant opened this issue Jan 31, 2024 · 2 comments
Open

Is there anyway to programically quit application? #4

ForceConstant opened this issue Jan 31, 2024 · 2 comments

Comments

@ForceConstant
Copy link

Once we do manager.start() is there anyway that the application can shut itself down without having to manually do Ctrl-C 2 times?

@alexbarcelo
Copy link
Owner

Not at the moment. The manager is a Thread instance which doesn't have a mechanism to stop it.

Internally, it calls to loop_forever. Adding the mechanism that you mention could be done through either:

  • loop_start & loop_stop (but this means changing the Thread "hierarchy" in some way)
  • loop (calling it repeatedly and checking for some stop condition).

I think it is a good improvement to include, but I won't be able to work on it for a while now. I am open to PR though 🤷 You can always add some kill mechanism as a workaround, or issuing a exit (which I believe should forcefully terminate the already started threads... I think).

@CptanPanic
Copy link

I got it to work by calling manager.client.disconnect() which stops the client loop, and causes manager to stop.

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

No branches or pull requests

3 participants