Rpyc Python:Rpyc服务线程启动调用阻塞

时间:2016-01-05 00:38:54

标签: multithreading service 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"

0 个答案:

没有答案