多个businessworker接收某一用户的同一消息

th

即gateWay将用户的某一消息多发到不同的businessworker,例如 用户的onclose事件发送到所有businessworker?

2856 2 0
2个回答

blogdaren

用户的 onClose 事件一般是针对当前连接的 close 事件,事件发生时会由某一个gateway进程接管并随机转发给某一个 businessworker 进程来处理,并不是发送到所有的 businessworker 进程。

  • th 2019-08-22

    就是需要事件由一个gateway进程转发到多个businessworker的这种功能。你所说的是businessworker的普通使用

  • blogdaren 2019-08-22

    只能修改源码,src/gateway.php 里定位到routerBind() 方法,自己看源代码很容易发现其为默认的 $this->router 回调,默认是随机路由一个businessworker,自行定制这个回调重写即可。

  • th 2019-08-22

    该方法不可行,回调也是有前提条件的

  • blogdaren 2019-08-22

    怎么就不可行了?

abcde123456

gateway是随机发送给某一个businessworker的 要发送给多个businessworker需要自行修改源代码

  • th 2019-08-22

    目前来看只有这样,目前没找到不修改源码的方法

年代过于久远,无法发表回答
🔝