V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
x14oL
V2EX  ›  PHP

laravel 5.1 中 command bus 与 jobs 的差别?

  •  
  •   x14oL · 2016-03-09 15:33:22 +08:00 · 3252 次点击
    这是一个创建于 2976 天前的主题,其中的信息可能已经有所发展或是发生改变。
    查过作者的 twitter 说是把原来的 command 文件夹改成 jobs 了,然后我查 5.1 的文档就没看到 command bus 这一条目,似乎两个东西能做的事情都一样。
    都是可以用在队列、异步等复杂集合操作中。有懂得同学回答一下吗?
    3 条回复    2016-03-09 22:12:45 +08:00
    fising
        1
    fising  
       2016-03-09 15:40:53 +08:00
    就是换掉了,至于区别我也不知道。我现在用的 jobs
    xujif
        2
    xujif  
       2016-03-09 15:47:54 +08:00
    功能上没什么不同,只要实现了 SelfHandling 甚至只要有 handle 方法都可以被 Queue,Bus , dispatch 分发。更多的是逻辑语义上的区分, job 文件夹里 base Job 实现了 Queueable 可以“方便”指定队列后台运行。
    xuwenmang
        3
    xuwenmang  
       2016-03-09 22:12:45 +08:00
    更新日志中有。

    5.1 应该只是改名了。

    5.2 不支持了。
    只支持自处理命令
    The Laravel 5.2 command bus now only supports self-handling commands and no longer supports separate commands and handlers.

    5.3 会被彻底移除
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   806 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 19:43 · PVG 03:43 · LAX 12:43 · JFK 15:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.