prom-client icon indicating copy to clipboard operation
prom-client copied to clipboard

add the ability to stop the event loop

Open justinmchase opened this issue 3 years ago • 2 comments

Fixes https://github.com/siimon/prom-client/issues/494

Adds an optional "stop" function which when called will ultimately disable the histogram which will allow the node process to exit.

I also fixed a bug in the tests where a failed assertion in a setTimeout wasn't properly rejecting the test promise.

Screen Shot 2022-02-25 at 8 52 49 AM

justinmchase avatar Feb 25 '22 16:02 justinmchase

I also fixed a bug in the tests where a failed assertion in a setTimeout wasn't properly rejecting the test promise.

Since we're waiting for node to respond, maybe that could be pulled into a separate PR so we can land it? 🙂

SimenB avatar Feb 26 '22 16:02 SimenB

Merged with the other PR that broke out the change to the tests.

Also, you probably don't need to wait for the node "unref" response since, even if they agree and add it, you'll still probably want a way to stop this as its reasonable to want to stop it without stopping the process. Also, if they do accept it it will likely go into node 17, in which case I'll have to wait for node 18 (lts) which could be years frankly.

justinmchase avatar Feb 28 '22 20:02 justinmchase