Scott f25056a201 first commit 1 bulan lalu
..
notice f25056a201 first commit 1 bulan lalu
AgentJob.php f25056a201 first commit 1 bulan lalu
AutoCommentJob.php f25056a201 first commit 1 bulan lalu
CheckQueueJob.php f25056a201 first commit 1 bulan lalu
LiveJob.php f25056a201 first commit 1 bulan lalu
MiniOrderJob.php f25056a201 first commit 1 bulan lalu
OrderCreateAfterJob.php f25056a201 first commit 1 bulan lalu
OrderExpressJob.php f25056a201 first commit 1 bulan lalu
OrderInvoiceJob.php f25056a201 first commit 1 bulan lalu
OrderJob.php f25056a201 first commit 1 bulan lalu
OtherOrderJob.php f25056a201 first commit 1 bulan lalu
OutPushJob.php f25056a201 first commit 1 bulan lalu
PinkJob.php f25056a201 first commit 1 bulan lalu
PosterJob.php f25056a201 first commit 1 bulan lalu
ProductCopyJob.php f25056a201 first commit 1 bulan lalu
ProductLogJob.php f25056a201 first commit 1 bulan lalu
ProductStockJob.php f25056a201 first commit 1 bulan lalu
README.md f25056a201 first commit 1 bulan lalu
RefundOrderJob.php f25056a201 first commit 1 bulan lalu
TakeOrderJob.php f25056a201 first commit 1 bulan lalu
TaskJob.php f25056a201 first commit 1 bulan lalu
TemplateJob.php f25056a201 first commit 1 bulan lalu
TranslateJob.php f25056a201 first commit 1 bulan lalu
UnpaidOrderCancelJob.php f25056a201 first commit 1 bulan lalu
UnpaidOrderSend.php f25056a201 first commit 1 bulan lalu
UpgradeJob.php f25056a201 first commit 1 bulan lalu
UserJob.php f25056a201 first commit 1 bulan lalu
filetree.txt f25056a201 first commit 1 bulan lalu

README.md

crmeb/app/jobs目录是CRMEB项目队列任务类的代码目录。

队列任务在项目开发中有以下几个重要作用:

  1. 异步处理。可以将一些耗时较长的任务放入队列以异步处理,不阻塞主线程。

  2. 延迟处理。可以指定队列任务在一定时间后异步执行,比如发送短信或邮件。

  3. 分布处理。可以将队列任务分布到不同服务器进行处理,提高服务器使用效率。

此目录下主要包含以下内容:

  • 每个任务类对应一个业务任务,实现Job接口。

  • 任务类内定义具体任务业务逻辑,如发送短信/邮件等。

  • 通过Broker进行任务的发送和异步处理。

  • 支持任务延时、失败重试等功能。

使用队列可以使得项目性能更优:

  • 阻塞任务剥离出来异步执行。

  • 分布式下每个任务独立运行,不阻塞其他进程。

  • 通过Broker复用同一服务,且伸缩性好。

所以此目录负责项目中所有异步任务的编写和调度,起到优化系统性能和扩展能力的重要作用。