done can also be called by stop()
493719
function executeNext(gremlin, i, callback) {
                if (stopped) return;
                if (i >= nb) return callback();
                executeInSeries([gremlin], [], horde, function() {
                    setTimeout(function() {
                        executeNext(gremlin, ++i, callback);
                    }, config.delay);
                });
            }
333110
def stop(self):
        
        if not self.active:
            return
        self.removeHandler(self.handlers[-1])
        self.active = False
        return
833478
synchronized void processFinished() {
        final InternalState required = this.requiredState;
        final InternalState state = this.internalState;
        // If the server was not stopped
        if(required == InternalState.STOPPED && state == InternalState.PROCESS_STOPPING) {
            finishTransition(InternalState.PROCESS_STOPPING, InternalState.PROCESS_STOPPED);
        } else {
            this.requiredState = InternalState.STOPPED;
            if ( !(internalSetState(getTransitionTask(InternalState.PROCESS_STOPPING), internalState, InternalState.PROCESS_STOPPING)
                    && internalSetState(getTransitionTask(InternalState.PROCESS_REMOVING), internalState, InternalState.PROCESS_REMOVING)
                    && internalSetState(getTransitionTask(InternalState.STOPPED), internalState, InternalState.STOPPED)) ){
                this.requiredState = InternalState.FAILED;
                internalSetState(null, internalState, InternalState.PROCESS_STOPPED);
            }
        }
    }
1255923
function(done) {
    this.async = true;
    var self = this;

    function finish(err, file) {
      var hasCallback = (typeof done === 'function');
      if (err && !hasCallback) return self.emit('error', err);
      if (err) return done(err);
      done(null, file);
    }

    if (this.data) {
      this.createFile(this.file, this.uri, this.file, this.data, finish).parse(finish);
    } else {
      this.resolve(this.file, this.cwd, function(err, file) {
        if (err) return finish(err);
        file.parse(finish);
      });
    }

    return this;
  }
297323
function stop(opts, done) {
  debug('stopping...');

  killIfRunning(opts, function(err) {
    debug('Any running workers have been sent a stop command');
    done(err);
  });
}
328736
def _stop(self):
        '''  '''
        duration = time.time() - self.start
        self.result['stop'] = str(datetime.datetime.now())
        self.result['delta'] = int(duration)

        if self.duration_unit == 'minutes':
            duration = round(duration / 60.0, 2)
        else:
            duration = round(duration, 2)

        self.result['stdout'] = "Paused for %s %s" % (duration, self.duration_unit)
961235
function() {
        var done = true,
            anim;
        for (anim in Transition._running) {
            if (Transition._running[anim]._runFrame) {
                done = false;
                Transition._running[anim]._runFrame();
            }
        }

        if (done) {
            Transition._stopTimer();
        }
    }
90825
def stop(self, handle, reason=None):
        """"""
        params = self._get_params(reason=reason)
        self._transport.stop(handle, params)
457039
def stop(self, *args, **kwargs):
        
        if self.status in (Status.stopping, Status.stopped):
            logger.debug("{} is already {}".format(self, self.status.name))
        else:
            self.status = Status.stopping
            self.onStopping(*args, **kwargs)
            self.status = Status.stopped
193384
function done( error, data ) {
		if ( error ) {
			return clbk( error );
		}
		data = transform( data );
		clbk( null, data );
	}
866926
function done(context, err, message) {
    if (err) return fail(context, err);
    if (typeof message !== "undefined") shell.write(message);
    context.end();
}
903787
def done(self):
        
        logger.info('Marking %s as done', self)

        fn = self.get_path()
        try:
            os.makedirs(os.path.dirname(fn))
        except OSError:
            pass
        open(fn, 'w').close()
555961
function () {
            this._handler = $B.bind(function (e) {
                ++this._count;
                this.dispatch( 'timer', {target: this, currentCount: this._count, data: this._data} );
                if ( this._repeatCount > 0 && this._repeatCount == this._count ) {
                    this.stop();
                    this.dispatch( 'complete', {target: this, currentCount: this._count, data: this._data} );
                }
            }, this);
        }
511645
function done(req, next, err, obj) {
    if (err) {
        req.error = {error: err.error || err.message};
    } else {
        req.provider = obj;
    }
    next();
}
181762
function done(err) {

			that._gcw = 'done_get_creatures';

			bomb.defuse();

			// Unsee the 'getting_creatures' event
			that.unsee('getting_creatures');

			// Call next on the next tick (in case we call back with an error)
			Blast.nextTick(next);

			if (err) {
				that.log('error', 'Error getting creatures: ' + err)
				callback(err);
			} else {

				let result = [];

				for (let id in that.creatures_by_id) {
					if (that.creatures_by_id[id]) {
						result.push(that.creatures_by_id[id]);
					}
				}

				callback(null, result);
				that.emit('_got_creatures', err, result);
			}
		}
136351
function get(done) {
    this.define();
    done(undefined, this.mixin({}, this.defaults, this.data, this.merge(
      this.data,
      this.queue.discharge(this.name)
    )));
  }
654201
def cancel(self):
        
        done = self.finished.is_set()
        self.finished.set()
        return not done