You’re very welcome! For fun, I actually went ahead and just tried the uWSGI RPC shim approach I mentioned – here: https://gist.github.com/akx/5585377 Basically shim(server, func) returns a function that looks like a normal function that can be registered directly with an unchanged XML-RPC dispatcher, but the function itself actually calls uwsgi.rpc() to call out to another node (without the overhead of XML-RPC :-) ).
Obviously there’s not much point in having uWSGI’s RPC laer inbetween if the function is declared in the same application (why not just register it locally with the dispatcher?), but the proof-of-concept is there and it works. Aarni From: [email protected] [mailto:[email protected]] On Behalf Of drácek mrácek Sent: Wednesday, May 15, 2013 7:42 PM To: uWSGI developers and users list Subject: Re: [uWSGI] Failing client request on RPC server Very nice!! Thank you Aarni :-) It works perfectly :) It's very clever solution. Thanks very much :) Tom On Wed, May 15, 2013 at 6:10 PM, Aarni Koskela <[email protected]<mailto:[email protected]>> wrote: Try this... :) It’s not complete and it probably doesn’t handle all corner cases right, but it works. It’s based on the Python XML-RPC docs, wrapped (more or less) neatly in a WSGI application. https://gist.github.com/akx/5585146 You could even make it actually delegate calls to uWSGI RPC if you wished by subclassing SimpleXMLRPCDispatcher or simply registering shims for uWSGI RPC functions within it. -Aarni From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of drácek mrácek Sent: Wednesday, May 15, 2013 6:47 PM To: uWSGI developers and users list Subject: Re: [uWSGI] Failing client request on RPC server Thank you for your reply. I like uWSGI for its powerful process management. So if I intend to use it something like XML-RPC server accessible by non-uwsgi process I guess I have to use it with internal routes (or with routes defined in Nginx). But then it won't be XML-RPC server I wanted to realize with uWSGI :-) Or I can use uwsgi protocol and every client webapp launch under uwsgi. But then I will lose the advantage of independence that comes with XML-RPC. T. On Wed, May 15, 2013 at 4:56 PM, Roberto De Ioris <[email protected]<mailto:[email protected]>> wrote: > Maybe it's silly question, but anyway - applying routing rules solved > problem with connecting via http client. But what if I would like to > connect with RPC client (to http-socket = :9090) directly to uwsgi RPC > server, ie like this > > s = xmlrpclib.ServerProxy('http://hostname:9090') > print s.hello() > > Above example will generate error: > --- no python application found, check your startup logs for errors --- > [pid: 19553|app: -1|req: -1/9] IP-ADDR () {32 vars in 529 bytes} [Wed May > 15 16:10:26 2013] GET /favicon.ico => generated 21 bytes in 0 msecs > (HTTP/1.1 500) 1 headers in 57 bytes (0 switches on core 0) > > And on client side will be raised xmlrpclib.ProtocolError > XML-RPC is at the same protocol level of uwsgi-RPC So you would need a XML-RPC to uwsgi-RPC translator (something pretty easy to realize, but no-one ever asked for it). So from the uwsgi point of view the pattern will became: http parsing -> xmlrpc parsing -> rpc call -> xmlrpc translation -> http response while now you have http parsing -> rpc call -> http response while using uwsgi.rpc() you have uwsgi parsing -> rpc call -> uwsgi response -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected]<mailto:[email protected]> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi _______________________________________________ uWSGI mailing list [email protected]<mailto:[email protected]> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
