Custom completion check that invokes the task's *workflow_complete* if it is callable, or
        just does the default completion check otherwise.
487836
def complete(self):
        
        if callable(self.task.workflow_complete):
            return self.task.workflow_complete()
        else:
            return super(BaseWorkflowProxy, self).complete()
405669
final void postComplete() {
        /*
         * On each step, variable f holds current dependents to pop
         * and run.  It is extended along only one path at a time,
         * pushing others to avoid unbounded recursion.
         */
        CompletableFuture<?> f = this; Completion h;
        while ((h = f.stack) != null ||
               (f != this && (h = (f = this).stack) != null)) {
            CompletableFuture<?> d; Completion t;
            if (f.casStack(h, t = h.next)) {
                if (t != null) {
                    if (f != this) {
                        pushStack(h);
                        continue;
                    }
                    h.next = null;    // detach
                }
                f = (d = h.tryFire(NESTED)) == null ? this : d;
            }
        }
    }
1136077
function invokeOnComplete(slinkerOptions) {
    if (typeof slinkerOptions.onComplete === 'function' && slinkerOptions.modules.length === symlinksCreated.length) {
        slinkerOptions.onComplete();
    }
}
133789
def generate_completions(event):
    
    """
    b = event.current_buffer

    # When already navigating through completions, select the next one.
    if b.complete_state:
        b.complete_next()
    else:
        event.cli.start_completion(insert_common_part=True, select_first=False)
941098
function onComplete (err) {
    if (err) {
      console.log('interpolation encountered an error: ', err)
      return callback(err)
    }
    // set is complete and create a queue drain function
    // however, a feed may not have any interpolated times, so
    // `isComplete` is set in case nothing is pushed to the queue
    isComplete = true
    updateQueue.drain = () => {
      console.log('interpolation completed successfully')
      callback(err)
    }
  }
940301
def _completion_checker(async_id, context_id):
    """"""

    if not context_id:
        logging.debug("Context for async %s does not exist", async_id)
        return

    context = FuriousContext.from_id(context_id)
    marker = FuriousCompletionMarker.get_by_id(context_id)

    if marker and marker.complete:
        logging.info("Context %s already complete" % context_id)
        return True

    task_ids = context.task_ids
    if async_id in task_ids:
        task_ids.remove(async_id)

    logging.debug("Loaded context.")
    logging.debug(task_ids)

    done, has_errors = _check_markers(task_ids)

    if not done:
        return False

    _mark_context_complete(marker, context, has_errors)

    return True
1289809
def _complete_task(self, task_name, **kwargs):
        

        logger.debug('Job {0} marking task {1} as completed'.format(self.name, task_name))
        self.run_log['tasks'][task_name] = kwargs

        for node in self.downstream(task_name, self.snapshot):
            self._start_if_ready(node)

        try:
            self.backend.acquire_lock()
            self._commit_run_log()
        except:
            logger.exception("Error in handling events.")
        finally:
            self.backend.release_lock()

        if kwargs.get('success', None) == False:
            task = self.tasks[task_name]
            try:
                self.backend.acquire_lock()
                if self.event_handler:
                    self.event_handler.emit('task_failed',
                                            task._serialize(include_run_logs=True))
            except:
                logger.exception("Error in handling events.")
            finally:
                self.backend.release_lock()

        self._on_completion()
333013
def _SetCompleted(self):
    
    with self._lock:
      if self._completed:
        return False
      self._completed = True
      return True
33258
private void taskComplete(
      HttpRemoteTaskRunnerWorkItem taskRunnerWorkItem,
      WorkerHolder workerHolder,
      TaskStatus taskStatus
  )
  {
    Preconditions.checkState(!Thread.holdsLock(statusLock), "Current thread must not hold statusLock.");
    Preconditions.checkNotNull(taskRunnerWorkItem, "taskRunnerWorkItem");
    Preconditions.checkNotNull(taskStatus, "taskStatus");
    if (workerHolder != null) {
      log.info(
          "Worker[%s] completed task[%s] with status[%s]",
          workerHolder.getWorker().getHost(),
          taskStatus.getId(),
          taskStatus.getStatusCode()
      );
      // Worker is done with this task
      workerHolder.setLastCompletedTaskTime(DateTimes.nowUtc());
    }

    // Notify interested parties
    taskRunnerWorkItem.setResult(taskStatus);
    TaskRunnerUtils.notifyStatusChanged(listeners, taskStatus.getId(), taskStatus);

    // Update success/failure counters, Blacklist node if there are too many failures.
    if (workerHolder != null) {
      blacklistWorkerIfNeeded(taskStatus, workerHolder);
    }

    synchronized (statusLock) {
      statusLock.notifyAll();
    }
  }
194135
def _trigger(self):
        
        self._completed.set()
        for callback in self._callbacks:
            callback(self)
1196138
public void complete() throws CompletionFailure {
        if (completer != null) {
            Completer c = completer;
            completer = null;
            c.complete(this);
        }
    }
103938
def on_complete(&block)
      on do |_, value, reason|
        block.call(reason == nil, value, reason)
      end
    end
152010
def start_completion(self, buffer_name=None, select_first=False,
                         select_last=False, insert_common_part=False,
                         complete_event=None):
        
        buffer_name = buffer_name or self.current_buffer_name
        completer = self._async_completers.get(buffer_name)

        if completer:
            completer(select_first=select_first,
                      select_last=select_last,
                      insert_common_part=insert_common_part,
                      complete_event=CompleteEvent(completion_requested=True))
767099
public void beforeCompletion()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "beforeCompletion");

        if (_state != TransactionState.STATE_ACTIVE)
        {
            MessageStoreRuntimeException mre = new MessageStoreRuntimeException(nls.getFormattedMessage("TRAN_PROTOCOL_ERROR_SIMS1001", new Object[]{}, null));
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(tc, "Cannot complete Transaction. Transaction is complete or completing!", mre);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
            throw mre;
        }

        for (int i = 0; i < _callbacks.size(); i++)
        {
            TransactionCallback callback = (TransactionCallback) _callbacks.get(i);
            callback.beforeCompletion(this);
        }

        // Do we have work to do?
        if (_workList != null)
        {
            try
            {
                _workList.preCommit(this);
            }
            catch (Throwable t)
            {
                FFDCFilter.processException(t, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion", "1:103:1.4.1.1", this);

                // An error has occurred during preCommit
                // so we need to trigger a rollback of our
                // transaction and therefore our connection
                // by throwing a runtime exception.
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(tc, "Throwing exception in beforeCompletion to ensure rollback due to Exception in preCommit!", t);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
                throw new MessageStoreRuntimeException(nls.getFormattedMessage("COMPLETION_EXCEPTION_SIMS1002", new Object[] {t}, null), t);
            }
        }

        // Need to change the state after we have 
        // called the callbacks and preCommitted 
        // the workList as they may trigger
        // an addWork call to add work to the
        // transaction.
        _state = TransactionState.STATE_COMMITTING_1PC;

        try
        {
            // Do we have work to do?
            if (_workList != null)
            {
                // Call the persistence layer to trigger our
                // database work on the shared connection.
                _persistence.beforeCompletion(this);
            }
        }
        catch (PersistenceException pe)
        {
            FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion", "1:134:1.4.1.1", this);
            // An error has occurred during the persistence
            // phase so we need to trigger a rollback of our
            // transaction and therefore our connection by
            // throwing a runtime exception.
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(tc, "Rollback-only set on transaction due to PersistenceException in beforeCompletion!", pe);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
            throw new MessageStoreRuntimeException(nls.getFormattedMessage("COMPLETION_EXCEPTION_SIMS1002", new Object[] {pe}, null), pe);
        }
        catch (SevereMessageStoreException smse)
        {
            FFDCFilter.processException(smse, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion", "1:145:1.4.1.1", this);
            // An error has occurred during the persistence
            // phase so we need to trigger a rollback of our
            // transaction and therefore our connection by
            // throwing a runtime exception.
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(tc, "Rollback-only set on transaction due to PersistenceException in beforeCompletion!", smse);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
            throw new MessageStoreRuntimeException(nls.getFormattedMessage("COMPLETION_EXCEPTION_SIMS1002", new Object[] {smse}, null), smse);
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "beforeCompletion");
    }
1369803
async def reportCompleted(self, *args, **kwargs):
        

        return await self._makeApiCall(self.funcinfo["reportCompleted"], *args, **kwargs)
255282
def check_complete(self):
        
        logger.debug('Running check_complete for task {0}'.format(self.name))

        # Tasks not completed
        if self.remote_not_complete() or self.local_not_complete():
            self._start_check_timer()
            return

        return_code = self.completed_task()

        # Handle task errors
        if self.terminate_sent:
            self.stderr += '\nDAGOBAH SENT SIGTERM TO THIS PROCESS\n'
        if self.kill_sent:
            self.stderr += '\nDAGOBAH SENT SIGKILL TO THIS PROCESS\n'
        if self.remote_failure:
            return_code = -1
            self.stderr += '\nAn error occurred with the remote machine.\n'

        self.stdout_file = None
        self.stderr_file = None

        self._task_complete(success=True if return_code == 0 else False,
                            return_code=return_code,
                            stdout=self.stdout,
                            stderr=self.stderr,
                            start_time=self.started_at,
                            complete_time=datetime.utcnow())
379380
def onComplete(self, *args, **kwargs):
        
        with transactUI(self):
            if self.clientRunner.was_success():
                if self.buildSpec.get('return_to_config', False):
                    self.showSettings()
                else:
                    self.showSuccess()
                    if self.buildSpec.get('show_success_modal', True):
                        wx.CallAfter(modals.showSuccess)
            else:
                if self.clientRunner.wasForcefullyStopped:
                    self.showForceStopped()
                else:
                    self.showError()
                    wx.CallAfter(modals.showFailure)