內容簡介
Action Scheduler 是一個可擴展、可追蹤的工作排程佇列,可在 WordPress 中背景處理大量的操作。這個工具特別設計用於分散在 WordPress 外掛中。
Action Scheduler 是透過觸發一個操作鉤子,讓它在將來某個時間執行。每個鉤子可以用唯一的資料來排程,讓回呼函數可以對該資料執行操作。這個鉤子也可以排程在一個或多個時間執行。
可以把它視為是 do_action() 的擴展,它添加了延遲和重複鉤子的功能。
受過驗證的背景處理
Action Scheduler 每個月處理了無數的付款,包括 訂閱配件、WooCommerce 的 Webhooks 以及其他外掛的電子郵件和事件。
它被看到在現場網站上處理多達 50,000 個工作佇列,並以持續速率超過 10,000 / 小時的節奏進行資源密集型操作,例如處理付款和建立訂單,而不會對正常的網站運作造成負面影響。
這全部都是在插件作者無法控制的基礎設施和 WordPress 網站上進行的。
如果您的外掛需要背景處理,特別是大量的任務,Action Scheduler 可以幫上忙。
了解更多
要了解有關 Action Scheduler 如何運作以及如何在您的外掛中使用它,請查看ActionScheduler.org上的文件。
在那裡您會找到:
使用指南:安裝和使用 Action Scheduler 的指示
WP CLI 指南:通過 WP CLI 運行 Action Scheduler 的指示
API 參考:所有 API 函數的完整參考指南
管理指南:通過管理畫面管理排程操作的指南
在規模上背景處理指南:通過預設的 WP Cron 佇列運行 Action Scheduler 的指示
致謝
Action Scheduler 由 Automattic 開發和維護,早期開發工作由 Flightless 完成。
合作很酷。我們很樂意與您合作,以改進 Action Scheduler。歡迎發送 Pull Request。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Action Scheduler is a scalable, traceable job queue for background processing large sets of actions in WordPress. It’s specially designed to be distributed in WordPress plugins.
Action Scheduler works by triggering an action hook to run at some time in the future. Each hook can be scheduled with unique data, to allow callbacks to perform operations on that data. The hook can also be scheduled to run on one or more occasions.
Think of it like an extension to do_action() which adds the ability to delay and repeat a hook.
Battle-Tested Background Processing
Every month, Action Scheduler processes millions of payments for Subscriptions, webhooks for WooCommerce, as well as emails and other events for a range of other plugins.
It’s been seen on live sites processing queues in excess of 50,000 jobs and doing resource intensive operations, like processing payments and creating orders, at a sustained rate of over 10,000 / hour without negatively impacting normal site operations.
This is all on infrastructure and WordPress sites outside the control of the plugin author.
If your plugin needs background processing, especially of large sets of tasks, Action Scheduler can help.
Learn More
To learn more about how Action Scheduler works, and how to use it in your plugin, check out the docs on ActionScheduler.org.
There you will find:
Usage guide: instructions on installing and using Action Scheduler
WP CLI guide: instructions on running Action Scheduler at scale via WP CLI
API Reference: complete reference guide for all API functions
Administration Guide: guide to managing scheduled actions via the administration screen
Guide to Background Processing at Scale: instructions for running Action Scheduler at scale via the default WP Cron queue runner
Credits
Action Scheduler is developed and maintained by Automattic with significant early development completed by Flightless.
Collaboration is cool. We’d love to work with you to improve Action Scheduler. Pull Requests welcome.
