RemoteActor.select - result deterministic?

a 夏天 提交于 2019-12-04 19:56:49

Your question got me curious so I had a quick look at the source ... here's what I found:

What select returns seems to depend on an object that handles the TCP connections. As this NetKernel remembers previously created proxies, the proxies are the same as long as the "current Netkernel" is the same. The current Netkernel depends on the current value of Actor.self, which might (I didn't dig that deep) on the current thread. For me that explains why r=a but p and i are different from that.

I guess, the reason for p and i being different is that a new NetKernel is associated with the actor by the alive(port) call (the actor's kernel needs to use the specified port, and not a random one).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!