Skip to content

Allow a callback to be passed in to call a function when the message has been sent? #17

@domharrington

Description

@domharrington

I would like to implement metrics in a child process and exit the process when it is complete.

timer.stop()
process.exit(0)

But what happens is the process exits before the message is sent. I can see a noop is being passed in as the callback parameter:

socket.send(buffer, 0, buffer.length, this.port, this.host, noop);

Would be great to be able to pass in a callback to the .stop() function call so my code will be:

timer.stop(function (err) {
  process.exit(0)
})

Would you accept a pull request for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions