@param StateMachineInterface|Callback $smOrCallback
@param callable                       $callback
@param array                          $spec

@return CallbackHandler
358777
public function addAfter($smOrCallback, $callback = null, array $spec = array())
    {
        $this->add($smOrCallback, FiniteEvents::POST_TRANSITION, $callback, $spec);

        return $this;
    }
1255587
public function handleNotify(callable $callback)
    {
        $notify = $this->getNotify();

        if (!$notify->isValid()) {
            throw new FaultException('Invalid request payloads.', 400);
        }

        $notify = $notify->getNotify();
        $successful = $notify->get('result_code') === 'SUCCESS';

        $handleResult = call_user_func_array($callback, [$notify, $successful]);

        if (is_bool($handleResult) && $handleResult) {
            $response = [
                'return_code' => 'SUCCESS',
                'return_msg'  => 'OK',
            ];
        } else {
            $response = [
                'return_code' => 'FAIL',
                'return_msg'  => $handleResult,
            ];
        }

        return new Response(XML::build($response));
    }
392039
public function handleRemaining(callable $callback)
    {
        $properties = $this->getRemainingMutations();
        if (!$properties) {
            // Nothing to do, don't register callback
            return;
        }

        foreach ($properties as $propertyName) {
            // HTTP Accepted
            $this->result[$propertyName] = 202;

            $this->propertyUpdateCallbacks[] = [
                $properties,
                $callback,
            ];
        }
    }
944786
protected function runLegacyKernelCallback($callback)
    {
        $this->persistenceCacheClearer->switchOff();
        $this->httpCacheClearer->switchOff();

        // Initialize legacy kernel if not already done
        if ($this->legacyKernel instanceof Closure) {
            $legacyKernelClosure = $this->legacyKernel;
            $this->legacyKernel = $legacyKernelClosure();
        }

        $return = $this->legacyKernel->runCallback(
            $callback,
            false,
            false
        );

        $this->persistenceCacheClearer->switchOn();
        $this->httpCacheClearer->switchOn();

        return $return;
    }
831463
function Channel(connection, spec) {
    this.connection = connection;
    this.channelId = spec.channelId;
    this.canPublish = spec.canPublish;
    this.subscribedTopics = [];
    this.fireCallbacks = {};
    this.prepareCallbacks = {};

    ObjectFsm(this);
    this.initStateMachine();

    /* Hackery */
    this.reportTransition('uninitialized');
}
1045490
void addCallbacks(Consumer<? super T> successCallback, Consumer<Throwable> failureCallback, Executor executor) {
        Objects.requireNonNull(successCallback, "'successCallback' must not be null");
        Objects.requireNonNull(failureCallback, "'failureCallback' must not be null");
        Objects.requireNonNull(executor, "'executor' must not be null");

        synchronized (mutex) {
            state = state.addCallbacks(successCallback, failureCallback, executor);
        }
    }
471812
public function withState(callable $callback)
    {
        $newState = clone $this;
        try {
            Injector::inst()->registerService($newState);
            return $callback($newState);
        } finally {
            Injector::inst()->registerService($this);
        }
    }
274794
public function when($condition, callable $trueCallback, callable $falseCallback = null)
    {
        if ($condition) {
            call_user_func($trueCallback, $this);
        } else {
            is_callable($falseCallback) && call_user_func($falseCallback, $this);
        }
        return $this;
    }
731015
static function executeCallback($callback, array $params = array()) {
    // If callback has @
    if (is_string($callback) && strpos($callback, '@') !== false) {
      // Split
      $arrCallback = explode('@', $callback);
      // Set object
      $object = class_exists($arrCallback[0]) ? (new $arrCallback[0]()) : null;
      // Set method
      $method = isset($arrCallback[0]) ? $arrCallback[0] : null;
      // Set callback
      $callback = array($object, $method);
    }
    // If not callable
    if ( ! is_callable($callback)) {
      // Throw error
      throw new InvalidCallback('Callback must be callable');
    }
    // Execute and return
    return call_user_func_array($callback, $params);
  }
77640
public function createFromCallback($callback): SpyVerifier
    {
        return new SpyVerifier(
            $this->spyFactory->create($callback),
            $this->matcherFactory,
            $this->matcherVerifier,
            $this->generatorVerifierFactory,
            $this->iterableVerifierFactory,
            $this->callVerifierFactory,
            $this->assertionRecorder,
            $this->assertionRenderer
        );
    }
803756
public function inputObserver($callback, $exitCicle = null)
    {
        if (self::isCli() === false || is_callable($callback) === false) {
            return false;
        }

        $this->io = $callback;
        $this->ec = $exitCicle ? $exitCicle : $this->ec;

        if ($this->started) {
            return true;
        }

        $this->started = true;
        $this->fireInputObserver();

        return true;
    }
673870
public function handle($callback = null, $errorsCallback = null)
    {
        if ($this->posted()) {
            $errors = $this->check();

            if (!$errors) {
                if (null !== $callback) {
                    $callback($this->getData());
                }
            } else {
                if (null !== $errorsCallback) {
                    $errorsCallback($errors);
                }
                return $errors;
            }
        }

        return array();
    }
1027756
public function subscribe($subject, \Closure $callback)
    {
        $c = function ($message) use ($callback) {
            $message->setBody($this->encoder->decode($message->getBody()));
            $callback($message);
        };
        return parent::subscribe($subject, $c);
    }
124654
public function monitor(callable $callback, $autostart = true)
    {
        $monitor = new Monitor\Consumer($this, $callback);

        if ($autostart) {
            $monitor->start();
        }

        return $monitor;
    }
176158
function load (spec, callback) {
    if ((spec instanceof Array) ||
        Object.prototype.toString.call(spec) === "[object Array]") {
      if (callback) {
        // load multiple and join on callback
        var countdown = spec.length;
        for (var i=0;i<spec.length;++i) {(function(u){
          load(u, function (err) {
            if (err) {
              countdown = 0;
              //throw err;
              callback(err);
            } else if (--countdown === 0) {
              callback();
            }
          });
        })(spec[i]);}
      } else {
        // load multiple (blocking) -- don't use this for network resources
        for (var i=0;i<spec.length;++i) {
          load(spec[i]);
        }
      }
      return;
    } else if (typeof spec === 'string') {
      spec = {url:spec};
    }
    if (!spec.url && spec.id) {
      spec.url = spec.id + '.js';
    } else if (spec.url && !spec.id) {
      var m = /^[^\/]+\/\/[^\/]+\/(.+)$/.exec(spec.url);
      if (m) {
        spec.id = m[1];
      } else {
        spec.id = spec.url;
      }
      spec.id = spec.id.replace(/\.[^\.]+$/, '');
    } else if (!spec.url && !spec.id) {
      throw new TypeError('missing both "url" and "id"');
    }
    // normalize url
    spec.url = normalizeUrl(spec.url, window.location);
    var xhr = new XMLHttpRequest();
    var async = !!callback;
    function evalResponse() {
      try {
        eval('require.define("'+spec.id+'",'+
             ' "'+spec.url.replace(/"/g, '\\"')+'"'+
             ', function (require, module, exports) {'+xhr.responseText+'});');
      } catch (err) {
        err.message += ' in '+spec.url;
        throw err;
      }
    }
    xhr.open('GET', spec.url, async);
    if (async) {
      xhr.onreadystatechange = function (ev) {  
        if (xhr.readyState == 4) {
          if ((xhr.status < 300 && xhr.status >= 200)
            || (xhr.status === 0 && !spec.url.match(/^(?:https?|ftp):\/\//i))) {
            try {
              evalResponse();
              callback(null);
            } catch (err) {
              callback(err);
            }
          } else {
            callback(new Error('failed to load remote module with HTTP'+
                               ' response status '+xhr.status+' '+
                               xhr.responseText));
          }
        }
      };
    }
    xhr.send(null);
    if (!async) {
      evalResponse();
    }
  }
680572
public static function checkCompareRules($rules, $valueCallback)
    {
        foreach(is_array($rules) ? $rules : [$rules] as $fieldName => $rule)
        {
            if(is_numeric($fieldName))
            {
                if(!static::checkCompareRule($rule, $valueCallback))
                {
                    return false;
                }
            }
            else if(preg_match('/^' . $rule . '$/', call_user_func($valueCallback, $fieldName)) <= 0)
            {
                return false;
            }
        }
        return true;
    }
1068543
protected function callClassBasedExtension( $callback, $parameters )
	{
		if ( Str::contains( $callback, '@' ) )
			list( $class, $method ) = explode( '@', $callback );
		else
			list( $class, $method ) = [$callback, 'validate'];

		return call_user_func_array( [BindingBuilder::resolveBinding( $class ), $method], $parameters );
	}