class AutomatedCron implements EventSubscriberInterface (View source)

A subscriber running cron after a response is sent.

Properties

protected CronInterface $cron

The cron service.

protected Config $config

The cron configuration.

protected StateInterface $state

The state key value store.

Methods

__construct(CronInterface $cron, ConfigFactoryInterface $config_factory, StateInterface $state)

Constructs a new automated cron runner.

onTerminate(PostResponseEvent $event)

Run the automated cron if enabled.

static array
getSubscribedEvents()

Registers the methods in this class that should be listeners.

Details

__construct(CronInterface $cron, ConfigFactoryInterface $config_factory, StateInterface $state)

Constructs a new automated cron runner.

Parameters

CronInterface $cron

The cron service.

ConfigFactoryInterface $config_factory

The config factory.

StateInterface $state

The state key-value store service.

onTerminate(PostResponseEvent $event)

Run the automated cron if enabled.

Parameters

PostResponseEvent $event

The Event to process.

static array getSubscribedEvents()

Registers the methods in this class that should be listeners.

Return Value

array

An array of event listener definitions.