Beh01der/node-docker-monitor

Provide a way to stop it

Closed this issue · 2 comments

Awesome lib.

It would be very useful to have a clean way to stop it, especially for integration testing.

Without much changes in the interface could be something like this:

 let stopMonitor = monitor(callbacks);

a bit cleaner but requires breaking changes:

let monitor = new Monitor(dockerConfig);

monitor.on('container:start', fn);
monitor.on('container:stop', fn);

monitor.start();
monitor.stop();

I've implemented it in 1.0.10

let m = monitor(callbacks);
m.stop();

I've also added 2 extra callback methods:

  • onMonitorStarted
  • onMonitorStopped

To start monitoring after stopping, you need to call monitor again

let m = monitor(callbacks);

Awesome, thanks

Il gio 28 lug 2016, 08:52 Andrey Chausenko notifications@github.com ha
scritto:

Closed #2 #2.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAUcIVVvcuLMiGhJ2I8e0ExLgyDOn_Qhks5qaFG-gaJpZM4JD8-R
.