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

Quitting a plugin #2

Closed
KillTheMule opened this issue Dec 13, 2019 · 1 comment
Closed

Quitting a plugin #2

KillTheMule opened this issue Dec 13, 2019 · 1 comment

Comments

@KillTheMule
Copy link
Owner

Right now, quitting a plugin using this lib is a mess, one basically has to call process::exit(_) and tear it all down from a task. What are our options?

Some thoughts:

  • Quitting happens upon a message from neovim, so we need to handle that. I tend to call this "quit", and just use a notification. Maybe just hardcode this? Maybe the name could/should be some kind of configuration option?
  • We probably also want to quit from out own code? If a task decides something went wrong, maybe he wants to signal the application to quit. How to do that? If nothing else, nvim.eval("rpcnotify(_, 'quit')") is possible, which we could wrap in a method on the requester.
  • What should happen on quitting? The io task should finish, so the main function that spawned it can notice and do whatever needs to be done. Need to return something useful from the io task then.
    • What to do about the other tasks that might still be running? I asked here, but got no answer.
      • Maybe collect the join handlers of all tasks globally?

Ideas welcome. MVP would be to handle a quit notification by returning from the handler.

@KillTheMule KillTheMule mentioned this issue Dec 13, 2019
17 tasks
@KillTheMule
Copy link
Owner Author

Implemented by 1df9ae0

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

1 participant