Skip to content

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