Triggers callback.

@return void
321261
public function afterAttach()
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->afterAttach($this);
        }
    }
29317
function trigger () {
  debug('trigger %j', arguments);
  if (!arguments.length) return;
  var args = slice.call(arguments);
  switch(args.length) {
  case 1:
    debug('one argument');
    emit.apply(this, args);
    break;
  case 2:
    debug('two arguments');
    if (args[1] && args[1].isMessage) {
      debug('it is a message %s', args[1].data.id);
      var msg = common.Message(args[1]);
      debug('vivified %s', msg.id());
      emit.apply(this, [args[0], msg ]); 
    }
    else {
      debug('it is not a message');
      emit.apply(this, args);
    }
    break;
  default:
    debug('more than one argument');
    emit.apply(this, args);
    break;
  }
}
683771
public function enableCallback()
    {
        $this->cb_view = $this->add('View');
        $this->cb_view->stickyGet('__atk_m', $this->name);
        $this->cb = $this->cb_view->add('CallbackLater');

        $this->cb->set(function () {
            if ($this->cb->triggered() && $this->fx) {
                $this->fx[0]($this->cb_view);
            }
            $modalName = isset($_GET['__atk_m']) ? $_GET['__atk_m'] : null;
            if ($modalName === $this->name) {
                $this->app->terminate($this->cb_view->renderJSON());
            }
        });
    }
68844
protected function setDataEditTrigger()
    {
        $conditions = $this->getData('trigger.data.conditions');

        if (empty($conditions) || !is_array($conditions)) {
            return null;
        }

        if (!$this->isError()) {
            gplcart_array_sort($conditions);
        }

        $modified = array();

        foreach ($conditions as $condition) {
            $modified[] = is_string($condition) ? $condition : $condition['original'];
        }

        $this->setData('trigger.data.conditions', implode("\n", $modified));
    }
1074750
public function eventCall()
    {
        try {
            //Daemon::log('cb - '.Debug::zdump($this->cb));
            $func = $this->cb;
            $func($this);
        } catch (\Exception $e) {
            Daemon::uncaughtExceptionHandler($e);
        }
    }
416202
public function trigger($type)
    {
        if (isset($this->callbacks[$type])) {
            foreach ($this->callbacks[$type] as $cb) {
                \pwf\helpers\SystemHelpers::call($this->prepareCallback($cb));
            }
        }
        return $this;
    }
50686
def trigger_hook(self, name, *args, **kwargs):
        """"""
        method = getattr(self, name, None)
        if is_callable(method):
            method(*args, **kwargs)
            
        try:
            children = self.children
        except AttributeError:
            return
        else:
            if children is not None:
                for child in children:
                    method = getattr(child, 'trigger_hook', None)
                    if is_callable(method):
                        method(name, *args, **kwargs)
                    else:
                        method = getattr(child, name, None)
                        if is_callable(method):
                            method(*args, **kwargs)
1007030
protected function updateTrigger($trigger_id)
    {
        if (!$this->isError() && !$this->trigger->update($trigger_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
1269356
protected function addTrigger()
    {
        if (!$this->isError()) {
            $state_id = $this->trigger->add($this->getSubmitted());
            if (empty($state_id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($state_id);
        }
    }
1254804
def trigger_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/triggers"
        return self.call(api_path, method="POST", data=data, **kwargs)
609483
public function tick()
    {
        // Only invoke as many callbacks as were on the queue when tick() was called.
        $count = $this->queue->count();

        while ($count--) {
            \call_user_func(
                $this->queue->dequeue()
            );
        }
    }
1148899
def trigger(self, event: str, *args: T.Any, **kw: T.Any) -> bool:
        """"""

        callbacks = list(self._events.get(event, []))
        if not callbacks:
            return False

        for callback in callbacks:
            callback(*args, **kw)
        return True
1137305
protected function registerTaskCallback()
    {
        $this->swooleServer->on('Task', function ($server, $taskId, $srcWorkerId, $data) {
            $this->events->dispatch(new Events\TaskTriggered($this, $taskId, $srcWorkerId, $data));

            $this->dispatchEvent('Task', $this, $taskId, $srcWorkerId, $data);
        });
    }
792872
public function triggerBeforeFind()
    {
        if (!$this->_beforeFindFired && $this->_type === 'select') {
            $this->_beforeFindFired = true;

            /** @var \Cake\Event\EventDispatcherInterface $repository */
            $repository = $this->getRepository();
            $repository->dispatchEvent('Model.beforeFind', [
                $this,
                new ArrayObject($this->_options),
                !$this->isEagerLoaded()
            ]);
        }
    }
300451
def event_trigger(self, event_type):
        """"""
        def callback(**kwargs):
            self.queued_events.append(event_type(**kwargs))
        return callback
1309222
public function trigger($name, array $args=[], $cb=null, &$chain=null) {
		if(!$this->getHookManager())
			return;
		return $this->getHookManager()->trigger($name, $args, $cb, $chain);
	}
948872
public function executeCallback()
    {
        if (method_exists($this->callbackObject, $this->callbackFunction)) {
            return call_user_func_array(array($this->callbackObject, $this->callbackFunction), $this->callbackParameters);
        }

        return null;
    }