Repository navigation
feat: queue async actions through Laravel and configure them from config/hooks.php - #427
Merged
Merged
Conversation
This was referenced Oct 7, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Async Actions, phase 3 step 1 (design doc "Pollora — Async Actions: implementation document"): the framework side of
->async().#[Async]comes in the next PR.Changes
pollora/hook^1.4(1.4.1 locked in CI): defaults, parameter injection, final failure thrown to the queue.config/hooks.php, merged, publishable with--tag=pollora-hooks:async.default(HOOKS_ASYNC_DRIVER, defaultauto),tries,backoff,as_user,queue.connection/queue.queue. Note:backoffsits at the top ofasyncand not underqueueas in the design doc, because it applies to every driver.QueueDriver: available only when the connection's driver is neithersync(would run in the request) nornull(would drop the job). It dispatchesRunAsyncActionon the configured connection, on the action's queue or the configured one, with the delay.RunAsyncActionjob:#[Tries(1)]: retries are new jobs, queued by the package after the backoff;Async::receive(..., throwOnFinalFailure: true): the last failure lands infailed_jobs, logged once by the queue;wp_cache_flush_runtime()before each handler, because a worker lives across jobs and WordPress's in-memory cache would hand stale posts. Notwp_cache_flush(), which would also empty a shared Redis;displayName():pollora/async {hook} {handler}, for Horizon andfailed_jobs.EloquentModelReference: a saved model travels as class, key and connection, and is reloaded at execution (SerializesModels); a deleted one drops the handler, as for WordPress objects.AsyncServiceProvider, registered afterHookServiceProvider:Async::setAutoDrivers(['queue', 'action-scheduler', 'wp-cron']);autoleaves the constant and the filter of pollora/hook in charge);setDefaults()from the configuration;setDebug(app.debug);useClosureKey(app.key);errorwhen they carry an exception,warningotherwise);reference(EloquentModelReference);injectParametersUsing()from the container.Tests
tests/Feature/Hook/Async): driver availability per connection, dispatched job, job run, final failure, cache flush, display name, model reference (SQLite), and every provider setting.pdo_sqlite).composer test:unitpasses--min=100without--coverage, so that threshold is not enforced, and the wholesrc/sits at 46 %.