Returns True if the call was successfully cancelled or finished
           running, False otherwise. This function updates the executionQueue
           so it receives all the awaiting message.
347305
def done(self):
        """"""
        # Flush the current future in the local buffer (potential deadlock
        # otherwise)
        try:
            scoop._control.execQueue.remove(self)
            scoop._control.execQueue.socket.sendFuture(self)
        except ValueError as e:
            # Future was not in the local queue, everything is fine
            pass
        # Process buffers
        scoop._control.execQueue.updateQueue()
        return self._ended()
852723
private boolean isExecutionPaused(Execution nextStepExecution) {
        // If execution was paused
        if (nextStepExecution == null) {
            //set current step to finished
            executionMessage.setStatus(ExecStatus.FINISHED);
            executionMessage.incMsgSeqId();
            executionMessage.setPayload(null);
            //execution was paused - send only the FINISHED message!
            try {
                outBuffer.put(executionMessage);
            } catch (InterruptedException e) {
                logger.warn("Thread was interrupted! Exiting the execution... ", e);
            }
            return true;
        } else {
            return false;
        }
    }
1269908
function (result) {
    // update status
    me.resolved = true;
    me.rejected = false;
    me.pending = false;

    _onSuccess.forEach(function (fn) {
      fn(result);
    });

    _process = function (onSuccess, onFail) {
      onSuccess(result);
    };

    _resolve = _reject = function () { };

    return me;
  }
431649
def done(self, retry=DEFAULT_RETRY):
        
        # Do not refresh is the state is already done, as the job will not
        # change once complete.
        if self.state != _DONE_STATE:
            self.reload(retry=retry)
        return self.state == _DONE_STATE
154932
@Override
    public boolean cancel(boolean mayInterruptIfRunning) {
        if (m_isDone == true) {
            return false;
        }
        m_isDone = true;

        if (m_pendingException != null) {
            return false;
        }

        m_cancelResult = m_schedFuture.cancel(false);

        if ((m_cancelResult != true) || (m_defaultFuture != null)) {
            // Push the cancel call to the Default Executor Future if it has progressed that far.
            try {
                this.m_coordinationLatch.await();
            } catch (InterruptedException ie) {
                // Try to proceed.
            }

            if (m_defaultFuture != null) {
                m_cancelResult = m_defaultFuture.cancel(mayInterruptIfRunning);
            }
        }

        if (m_cancelResult == true) {
            m_pendingException = new CancellationException();
            m_scheduledExecutorQueue.remove(this);
        }

        // Let get() finish
        this.m_coordinationLatch.countDown();

        return m_cancelResult;
    }
900238
public boolean isTerminated() {
		final Thread executingThread = this.environment.getExecutingThread();
		if (executingThread.getState() == Thread.State.TERMINATED) {
			return true;
		}

		return false;
	}
516961
private boolean jobHasFailedOrCanceledStatus() {

		final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(this, true);

		while (it.hasNext()) {

			final ExecutionState state = it.next().getExecutionState();

			if (state != ExecutionState.CANCELED && state != ExecutionState.FAILED && state != ExecutionState.FINISHED) {
				return false;
			}
		}

		return true;
	}
196995
function done() {
      // We don't care if we were rejected.
      if (rejected === true) {
        return;
      }
      // Decrement the number of async tasks we are waiting on.
      waiting--;
      // If we are finished waiting then we want to resolve our promise.
      if (waiting <= 0) {
        if (waiting === 0) {
          _resolve(filePaths);
        } else {
          reject(new Error(`Expected a positive number: ${waiting}`));
        }
      }
    }
592530
public boolean isCompleted() {
    WorkingState state = getWorkingState();
    return state == WorkingState.SUCCESSFUL || state == WorkingState.COMMITTED || state == WorkingState.FAILED;
  }
507239
def _return_result(self, done):
        
        chain_future(done, self._running_future)

        self.current_future = done
        self.current_index = self._unfinished.pop(done)
849872
public function finished()
    {
        if ($this->tasksCount == 0) {
            if (isset($this->callback)) {
                $results = array();
                foreach ($this->tasks as $task) {
                    $results[] = $task->result;
                }

                call_user_func($this->callback, $results);
            }

            return true;
        }

        return false;
    }
1331999
def result(self):
        
        # Send None to all threads to cleanly stop them
        for _ in range(self.num_threads):
            self.tasks_queue.put(None)
        # Wait for completion of all the tasks in the queue
        self.tasks_queue.join()
        # Check if one of the thread raised an exception, if yes
        # raise it here in the function
        if not self.exceptions_queue.empty():
            raise self.exceptions_queue.get()
        return self.results_queue
669869
def is_stop(self):
        '''  '''
        if len(self._processed_coordinators) > 0:
            self.free_processed_queue()
        return self._cancel_called or self._processing_stop
409471
function(callback) {
    if (typeof callback === 'function') {
      this.afterSync(callback);
    }

    if (this.pendingSync) {
      clearTimeout(this.pendingSync.pop());
      this.pendingSync.forEach(this.cancelQueue);
      this.pendingSync = null;
    }

    if (this.syncing) {
      this.rerun = true;
      return false;
    }

    this.runSync();
    return true;
  }
548886
function _done (cb, message) {
  var valid = false

  if (typeof message === 'string') {
    message = [message]
  } else if (Object.prototype.toString.call(message) === '[object Array]') {
    if (message.length === 0) {
      valid = true
    }
  } else {
    valid = true
  }

  if (isFunction(cb)) {
    if (valid) {
      cb(valid, [])
    } else {
      cb(valid, message)
    }
  }

  return valid
}
66605
def _future_done(self, future):
        
        try:
            # notify the subscribers (except result is an exception or NONE)
            result = future.result()  # may raise exception
            if result is not NONE:
                self.notify(result)  # may also raise exception
        except asyncio.CancelledError:
            return
        except Exception:  # pylint: disable=broad-except
            self._options.error_callback(*sys.exc_info())

        # check if queue is present and something is in the queue
        if self._queue:
            value = self._queue.popleft()

            # start the coroutine
            self._run_coro(value)
        else:
            self._future = None
7449
def finished_or_stopped(self):
        
        return (self._status.execution_mode is StateMachineExecutionStatus.STOPPED) or \
               (self._status.execution_mode is StateMachineExecutionStatus.FINISHED)