Pra*_*gam 5 service multithreading blocking rpyc
服务器启动正常,我可以更新值,但不会打印 hello world 字符串。程序卡在t.start()处,如何使其非阻塞。
import rpyc
class rpyc_service(rpyc.Service):
def on_connect(self):
self.exposed_var = 0
def on_disconnect(self):
pass
def exposed_update_var(self, val):
self.exposed_var = val
if __name__ == '__main__':
from rpyc.utils.server import ThreadedServer
t = ThreadedServer(rpyc_service, port = 18861)
t.start()
# The hello world section is never printed
print "Hello world"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1044 次 |
| 最近记录: |