Laravel 速查表
显示全部 1. Artisan 2. Auth 3. Blade 4. Cache 5. Collection 6. Composer 7. Config 8. Container 9. Cookie 10. DB 11. Environment 12. Event 13. File 14. Helper 15. Input 16. Lang 17. Log 18. Mail 19. Model 20. Pagination 21. Queue 22. Redirect 23. Request 24. Response 25. Route 26. Schema 27. Security 28. Session 29. Storage 30. String 31. URL 32. UnitTest 33. Validation 34. View
Menu

Queue

未匹配的标注
本文档最新版为 9.x,旧版本可能放弃维护,推荐阅读最新版!
Queue::push('SendMail', array('message' => $message));
Queue::push('SendEmail@send', array('message' => $message));
Queue::push(function($job) use $id {});
// 在多个 workers 中使用相同的负载
 Queue::bulk(array('SendEmail', 'NotifyUser'), $payload);
// 开启队列监听器
php artisan queue:listen
php artisan queue:listen connection
php artisan queue:listen --timeout=60
// 只处理第一个队列任务
php artisan queue:work
// 在后台模式启动一个队列 worker
php artisan queue:work --daemon
// 为失败的任务创建 migration 文件
php artisan queue:failed-table
// 监听失败任务
php artisan queue:failed
// 通过 id 删除失败的任务
php artisan queue:forget 5
// 删除所有失败任务
php artisan queue:flush
// 因为队列不会默认使用 PHP memory 参数,需要在队列指定(单位默认mb)
php artisan queue:work --memory=50

本文章首发在 LearnKu.com 网站上。

上一篇 下一篇
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 0
发起讨论 查看所有版本


暂无话题~