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 graceful shutdown for requesters and responders #270

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

otothea
Copy link
Contributor

@otothea otothea commented Feb 5, 2023

Adds support for callback when calling .close() on a component to allow graceful shutdown.

If a callback is passed then the component will:

  • immediately close discovery
  • Wait for message queue to drain before calling callback

example use case:

const Responder = require('cote').Responder;

...

process.once('SIGINT', () => {
    randomResponder.close(() => {
        process.exit();
    });
});

@daniandl
Copy link

Hate to be that guy, but, what is stopping this from being merged?

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.

3 participants