What is the reason that global arrays cannot be used in the event callback function of swoole?

  node.js, question

图片描述

图片描述

如图所示,在顶级作用域中显式声明的数组在onmessage事件的回调函数中调用不到,每次都是重新使用了一个新数组然后进行操作,我试过global关键字也不起作用,还有use中的变量前面加上&引用符号也不起作用,这该怎么办啊?

This is called Process isolation. In fact, the official document of swoole says.

clipboard.png