lib/index.js
function processDockerEvent(event, stop) {
    if (trackedEvents.indexOf(event.status) !== -1) {
      var container = containerById.get(event.id);
      if (container) {
        if (positiveEvents.indexOf(event.status) !== -1) {
          updateContainer(container);
        } else {
          removeContainer(container);
        }
      } else {
        // new container
        if (!stop && positiveEvents.indexOf(event.status) !== -1) {
          updateContainers(function(err) {
            if (!err) {
              processDockerEvent(event, true);
            }
          });
        }
      }
    }
  }
function processDockerEvent(event, stop) {
    if (trackedEvents.indexOf(event.status) !== -1) {
      var container = containerById.get(event.id);
      if (container) {
        if (positiveEvents.indexOf(event.status) !== -1) {
          updateContainer(container);
        } else {
          removeContainer(container);
        }
      } else {
        // new container
        if (!stop && positiveEvents.indexOf(event.status) !== -1) {
          updateContainers(function(err) {
            if (!err) {
              processDockerEvent(event, true);
            }
          });
        }
      }
    }
  }
function processDockerEvent ( event , stop ) { if ( trackedEvents . indexOf ( event . status ) !== - 1 ) { var container = containerById . get ( event . id ) ; if ( container ) { if ( positiveEvents . indexOf ( event . status ) !== - 1 ) { updateContainer ( container ) ; } else { removeContainer ( container ) ; } } else { // new container if ( ! stop && positiveEvents . indexOf ( event . status ) !== - 1 ) { updateContainers ( function ( err ) { if ( ! err ) { processDockerEvent ( event , true ) ; } } ) ; } } } }
start monitoring docker events
start monitoring docker events