尤川豪   ·  5年前
445 貼文  ·  275 留言

Laravel Queues 的應用?

發現 laravel helpers 有幾個 helpers

https://laravel.com/docs/5.7/helpers#method-dispatch

https://laravel.com/docs/5.7/helpers#method-dispatch-now

https://laravel.com/docs/5.7/helpers#method-event

dispatch()
dispatch_now()
event()

用這些搭配 queues 的觀念 可以設計出一套好用、易擴充的架構嗎?

一直都是用大量 service objects 去做架構,有點膩了


laravel queues 只能用做 message queue 的用途嗎?

可以用來作為 command pattern 的雛型?register & execute pattern?


應該不行,queue 就是 message queue,搭累 dispatch 與 dispatch_now

與 command pattern 相關的應該是 event

https://laravel.com/docs/5.7/events

  分享   共 1,283 次點閱
共有 1 則留言
尤川豪   ·  5年前
445 貼文  ·  275 留言
 
您的留言
尤川豪
445 貼文  ·  275 留言

Devs.tw 是讓工程師寫筆記、網誌的平台。隨手紀錄、寫作,方便日後搜尋!

歡迎您一起加入寫作與分享的行列!

查看所有文章