Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

This module allows developers to delay the execution of specific code-related events until after the page has been sent to the user, or even schedule them for a future time. It's designed to prevent non-critical, time-consuming tasks from slowing down page loads and improving user experience.

This module allows specific (code) events to be delayed until the end of page execution, or even until a scheduled time in the future.

This module has nothing to do with calendar or real-world events. It's a code thing only.

THIS CODE DOES NOTHING ON ITS OWN. IT SHOULD NOT BE ADDED UNLESS ANOTHER MODULE NEEDS IT.

The Problem with Events

System events are executed at the time they are issued. This means that non-critical actions might be executed during the page build and therefore delay it.

For example, (using exaggerated times just for illustration), the action of a form might be to save an entity but also send ten emails to interested users.

Let's say it takes 0.05 seconds to save the entity, and it takes 0.10 seconds to send a single email. The site should be building the next page after 0.05 seconds, but it has to send 10 emails, so it adds a whole second to the time.

But the event is working exactly the same as an old Drupal hook, it has to be acted on right at that moment.

Delayed events

How about if you could delay all that non-critical processing until after the main page processing is complete?

You can.

All you have to do is queue non-critical events until the Symfony Kernel sends its Terminate event (meaning the page has been sent), then execute all those non-critical queued events.

In this example it means the page is delivered after 0.05 seconds, while the time-consuming emails are sent afterwards.

This module provides that choice when dispatching events, and another (even better) one:

  • Delayed events: Execute after the page has been sent to the user, which means it will not add time to the user experience of the page.
  • Scheduled events: Allow an event to be held until some time in the future then it is launched and can be executed.

How it works

If you want an event to be delayed or scheduled you add either one of two interfaces to the custom event class, and then you use a custom event dispatcher. The custom dispatcher treats ordinary events just the way the usual dispatcher does, it adds delayed events to a queue which it executes after the rest of the page, and sends scheduled events to the database where they wait until it's time for them to be launched.

A full explanation is given in the module's README.md file.

Additional modules

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Aug 2025
Latest release
6 months ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
2.3.0-rc6 Pre-release 9–10 Feb 21, 2026
2.3.0-rc5 Pre-release 9–10 Feb 14, 2026
2.3.0-rc4 Pre-release 9–10 Aug 27, 2025