This happens because both start()
calls start Tornado IOLoop and they won't exit until IOLoop stopped.
Yes, you have to use one IOLoop. As msgpackrpc.Server
accepts Loop
class instance and Loop
incapsulates IOLoop
, try this:
if __name__ == '__main__':
io_loop = tornado.ioloop.IOLoop.instance()
loop = msgpackrpc.Loop(io_loop)
rpc = msgpackrpc.Server(RPCServer(), loop=loop)
# ... sockjs-tornado initialisation. No need to call rpc.start()
io_loop.start()