Determine if an event mutex exists for the given event.

@param  \Illuminate\Console\Scheduling\Event  $event
@return bool
192878
public function exists(Event $event)
    {
        return $this->cache->store($this->store)->has($event->mutexName());
    }
1005468
private function shouldHandle($event)
    {
        if ($event instanceof TransactionalEvent) {
            return true;
        }

        $event = is_string($event) ? $event : get_class($event);

        foreach ($this->excluded as $excluded) {
            if ($this->matches($excluded, $event)) {
                return false;
            }
        }

        foreach ($this->transactional as $transactionalEvent) {
            if ($this->matches($transactionalEvent, $event)) {
                return true;
            }
        }

        return false;
    }
408453
function off(string $event, $callback): bool
    {
        return $this->getEventEmitter()->off($event, $callback);
    }
898236
protected function eventExpired($event)
    {
        $cachedDiff = $this->getCachedEvent($event)->diffInSeconds(Carbon::now());

        return $cachedDiff < $this->config('root.cache.event_timeout', 10);
    }
132665
private function isEventSupported(Event $event): bool
    {
        $supported = false;

        foreach ($this->getSupportedEventTypes() as $supportedEventType) {
            if (\is_a($event, $supportedEventType)) {
                $supported = true;

                break;
            }
        }

        return $supported;
    }
1361756
public function onEventRegistration(Event $event)
    {
        $this->unitOfWork->publishEvent($event, $this->eventBus);

        return $this->unitOfWork->invokeEventRegistrationListeners($event);
    }
1341992
public function iWaitForAjaxToFinish($event = null)
    {
        $condition = <<<JS
    (function() {
      function isAjaxing(instance) {
        return instance && instance.ajaxing === true;
      }
      var d7_not_ajaxing = true;
      if (typeof Drupal !== 'undefined' && typeof Drupal.ajax !== 'undefined' && typeof Drupal.ajax.instances === 'undefined') {
        for(var i in Drupal.ajax) { if (isAjaxing(Drupal.ajax[i])) { d7_not_ajaxing = false; } }
      }
      var d8_not_ajaxing = (typeof Drupal === 'undefined' || typeof Drupal.ajax === 'undefined' || typeof Drupal.ajax.instances === 'undefined' || !Drupal.ajax.instances.some(isAjaxing))
      return (
        // Assert no AJAX request is running (via jQuery or Drupal) and no
        // animation is running.
        (typeof jQuery === 'undefined' || (jQuery.active === 0 && jQuery(':animated').length === 0)) &&
        d7_not_ajaxing && d8_not_ajaxing
      );
    }());
JS;
        $ajax_timeout = $this->getMinkParameter('ajax_timeout');
        $result = $this->getSession()->wait(1000 * $ajax_timeout, $condition);
        if (!$result) {
            if ($ajax_timeout === null) {
                throw new \Exception('No AJAX timeout has been defined. Please verify that "Drupal\MinkExtension" is configured in behat.yml (and not "Behat\MinkExtension").');
            }
            if ($event) {
                /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
                $event_data = ' ' . json_encode([
                    'name' => $event->getName(),
                    'feature' => $event->getFeature()->getTitle(),
                    'step' => $event->getStep()->getText(),
                    'suite' => $event->getSuite()->getName(),
                ]);
            } else {
                $event_data = '';
            }
            throw new \RuntimeException('Unable to complete AJAX request.' . $event_data);
        }
    }
191293
protected function is_event_ignored(\core\event\base $event) {
        if ((!CLI_SCRIPT or PHPUNIT_TEST) and !$this->logguests) {
            // Always log inside CLI scripts because we do not login there.
            if (!isloggedin() or isguestuser()) {
                return true;
            }
        }
        return false;
    }
1292842
public function handleEventScriptEvent($event)
    {
        \Cache::forget(Cache::EVENT_SCRIPT_CACHE_PREFIX . $event->script->name);

        return true;
    }
1018481
protected static function delete_event( stdClass $event ) {
		$crons = _get_cron_array();

		if ( ! isset( $crons[ $event->time ][ $event->hook ][ $event->sig ] ) ) {
			return false;
		}

		wp_unschedule_event( $event->time, $event->hook, $event->args );
		return true;
	}
363059
public function publish(Event $event)
    {
        $value = $this->serializer->serialize($event);

        return (bool) $this->client->rpush($this->queue_name, [$value]);
    }
917320
public function forget(Event $event)
    {
        $this->cache->store($this->store)->forget($event->mutexName());
    }
280805
public function create(Event $event)
    {
        return $this->cache->store($this->store)->add(
            $event->mutexName(), true, $event->expiresAt * 60
        );
    }
1139123
public function triggerEvent($event)
	{
		if (!($event instanceof EventInterface))
		{
			if (isset($this->events[$event]))
			{
				$event = $this->events[$event];
			}

			else
			{
				$event = new Event($event);
			}
		}

		if (isset($this->listeners[$event->getName()]))
		{
			foreach ($this->listeners[$event->getName()] as $listener)
			{
				if ($event->isStopped())
				{
					return $event;
				}

				if ($listener instanceof Closure)
				{
					call_user_func($listener, $event);
				}

				else
				{
					call_user_func(array($listener, $event->getName()), $event);
				}
			}
		}

		return $event;
	}
103712
public function validateEventExist($event, $events)
    {
        if ($event == '') {
            return null;
        }

        if (!in_array($event, array_values($events))) {
            throw new \InvalidArgumentException(sprintf('Event "%s" is invalid.', $event));
        }

        return $event;
    }
182054
public function listenToMethodNotFound($event)
    {
        if ('getServiceContainer' == $event['method']) {
            $event->setReturnValue($this->containerManager->getServiceContainer());
            return true;
        }

        if ('getContainerBuilder' == $event['method']) {
            $event->setReturnValue($this->containerManager->getContainerBuilder());
            return true;
        }

        if ('getService' == $event['method']) {
            $event->setReturnValue($this->containerManager->getServiceContainer()->get($event['arguments'][0]));
            return true;
        }

        return false;
    }
274190
public function listenersOfEvent(Event $event)
    {
        $event_name = get_class($event);

        return isset($this->listeners[$event_name]) ? $this->listeners[$event_name] : [];
    }