I’m very new to python-pulsar, so please bear with me.I'm trying to use the Twisted compatibility mode of pulsar, since this
is the only way I know of to get a XML-RPC server running under
asyncio.
from pulsar.apps.rpc import RpcHandler
class XMLRPC(RpcHandler):
def __call__(self, request):
...
from pulsar.apps import wsgi
class MyRpc(XMLRPC):
def rpc_add(self, request, a, b):
return a+b
class Wsgi(wsgi.LazyWsgi):
def handler(self, environ=None): app = wsgi.Router('/', post=MyRpc()) return wsgi.wsgiHandler([app])
if __name__ == '__main__': wsgi.WsgiServer(Wsgi()).start()
If I comment out the following lines:
from pulsar.apps.tx import tx
from pulsar.utils.log import process_global
and add a reactor.run() call to main(), the script runs my XML-RPC
server, with repeated calls to 'doPoll()', as I expect.
2) If have two different files in my application that both import pulsar.apps.tx, won’t this cause two calls to _reactor.run()?