Success/pending callbacks are currently aliases, this may change
 if required.
432948
def success
      payment.order.next
      flash.notice = Spree.t(:order_processed_successfully)
      flash['order_completed'] = true
      redirect_to spree.order_path(payment.order)
    end
42137
def callback_result(self):
        """"""
        if self._state in [PENDING, RUNNING]:
            self.x
        if self._user_callbacks:
            return self._callback_result
        else:
            return self.x
1158544
def on_change(self, *callbacks):
        ''' 

        '''
        for callback in callbacks:

            if callback in self._callbacks: continue

            _check_callback(callback, ('event',))

            self._callbacks[callback] = callback
1085575
def call_nowait(self, cb_name):
        
        if self.bootstrapping:
            return
        if cb_name in (ACTION_ON_START, ACTION_ON_STOP, ACTION_ON_RESTART, ACTION_ON_ROLE_CHANGE):
            self.__cb_called = True

        if self.callback and cb_name in self.callback:
            cmd = self.callback[cb_name]
            try:
                cmd = shlex.split(self.callback[cb_name]) + [cb_name, self.role, self.scope]
                self._callback_executor.call(cmd)
            except Exception:
                logger.exception('callback %s %s %s %s failed', cmd, cb_name, self.role, self.scope)
552055
def run_callback(self):
        

        if self._callback_func is not None:
            try:
                self._callback_func(self._request, self._result)
            except Exception:  # pylint: disable=broad-except
                LOGGER.exception('An unhandled error occurred while running '
                                 'future callback')
1070456
def callback(self, result, message):
        
        self.results.put(result)
        message.ack()
850608
def handle_aliases_in_calls(name, import_alias_mapping):
    
    for key, val in import_alias_mapping.items():
        # e.g. Foo == Foo
        # e.g. Foo.Bar startswith Foo.
        if name == key or \
                name.startswith(key + '.'):

            # Replace key with val in name
            # e.g. StarbucksVisitor.Tea -> Eataly.Tea because
            #   "from .nested_folder import StarbucksVisitor as Eataly"
            return name.replace(key, val)
    return None
87077
function callbackMiddleware (req, res, next) {
  if (req.url.indexOf('callback') === -1) {
    next()
  } else if (req.url.indexOf('error') === -1) {
    res.status(200).jsonp({ created: true })
  } else {
    res.status(400).jsonp({ error: true })
  }
}
125098
def add_callbacks(self, future, callback, errback):
        
        assert future is not None
        if callback is None:
            assert errback is not None
            future.addErrback(errback)
        else:
            # Twisted allows errback to be None here
            future.addCallbacks(callback, errback)
        return future
1019821
def clean_aliases(ctx, force_yes):
    
    inactive_aliases = []

    for (alias, mapping) in six.iteritems(aliases_database):
        # Ignore local aliases
        if mapping.mapping is None:
            continue

        project = ctx.obj['projects_db'].get(mapping.mapping[0],
                                             mapping.backend)

        if (project is None or not project.is_active() or
                (mapping.mapping[1] is not None
                 and project.get_activity(mapping.mapping[1]) is None)):
            inactive_aliases.append(((alias, mapping), project))

    if not inactive_aliases:
        ctx.obj['view'].msg("No inactive aliases found.")
        return

    if not force_yes:
        confirm = ctx.obj['view'].clean_inactive_aliases(inactive_aliases)

    if force_yes or confirm:
        ctx.obj['settings'].remove_aliases(
            [item[0] for item in inactive_aliases]
        )
        ctx.obj['settings'].write_config()
        ctx.obj['view'].msg("%d inactive aliases have been successfully"
                            " cleaned." % len(inactive_aliases))
1037510
def on_status_update(self, channel, callback):
        
        if channel not in self._callbacks:
            self._callbacks[channel] = []
        self._callbacks[channel].append(callback)
246186
function handle(err, results) {
      if (err) {
        errors = errors || [];
        errors.push(err);
      }
      if (results) responses = responses.concat(results);

      // multi calls should ALWAYS return an array!
      if (!--calls) {
          callback(errors && errors.length ? errors.pop() : undefined, responses);
      }
    }
711584
function(callbacks, args) {
            if (!callbacks.length) {
                return typeof done === 'function' ? done() : true;
            }

            var callback = callbacks.shift();
            callback.apply(context, args);

            // Is the callback synchronous ?
            if (callback.length === nbArguments) {
                iterator(callbacks, args, done);
            }
        }
196400
@Override
  public void onSuccess(T result) {
    checkState();
    for (Callback<T> cb : callbacks) {
      cb.onSuccess(result);
    }
    callbacks = null; // note that we've fired
  }
99659
def pop_result(self, key):
        """"""
        self.pending_callbacks.remove(key)
        return self.results.pop(key)
1075834
def call_sync_callbacks(self):
        
        current_cycles = self.cycles
        for callback_cycles, callback in self.sync_callbacks:
            # get the CPU cycles count of the last call
            last_call_cycles = self.sync_callbacks_cyles[callback]

            if current_cycles - last_call_cycles > callback_cycles:
                # this callback should be called

                # Save the current cycles, to trigger the next call
                self.sync_callbacks_cyles[callback] = self.cycles

                # Call the callback function
                callback(current_cycles - last_call_cycles)
431321
function handleIt(cb) {
    callbacks = cb;
    broadcast = callbacks.broadcast;

    let msg = {
      cmd: MessageType.RockPaperScissors,
      handlerId: id
    };
    broadcast("action", msg);

    // Return a promise for the result
    deferred = q.defer();
    return deferred.promise;
  }