wp-cli / cron-command

Tests, runs, and deletes WP-Cron events; manages WP-Cron schedules.
MIT License
31 stars 27 forks source link

Laravel style daemon worker #84

Closed Saggre closed 2 years ago

Saggre commented 2 years ago

I'd like to implement and create a PR for a Laravel style wp-cron worker.

The idea is to constantly keep WordPress loaded in a separate process to avoid allocating and de-allocating memory every time wp cron event run is called. The worker would then process any wp-cron events that become due. I'm hoping this would free up resources on the server.

The command itself would look something like wp cron event worker or wp cron event daemon

Laravel documentation: https://laravel.com/docs/9.x/queues#the-queue-work-command

What do you think?

danielbachhuber commented 2 years ago

@Saggre Have you seen https://github.com/humanmade/Cavalcade ? It might save you some effort 😁

Saggre commented 2 years ago

@danielbachhuber I wasn't aware of this. Thanks for the heads up. No point in reinventing the wheel then.