[Stackless] Problem with xmlrpc over stacklesssocket
omyar_hunt at yahoo.co.uk
Thu Sep 23 14:24:33 CEST 2010
Interesting, thanks for the feedback, I hadn't realised the xmlrpc server comes with a handle_request() method, which is obviously much better.
Oddly enough I can't get the demo to run for love nor money, but I've recently switched strategies and have put together a simplistic json-based rpc thing instead, using basic sockets (using socket.recv and socket.sendall calls).
I'm still getting my head round concepts like the difference between poll and select (xmlrpcserver seems to use select) and what effect they have on the implementation. Your comment about the 0.5 second wait time was a real facepalm moment for me :)
Anyways thanks for the help.
--- On Thu, 23/9/10, Richard Tew <richard.m.tew at gmail.com> wrote:
> From: Richard Tew <richard.m.tew at gmail.com>
> Subject: Re: [Stackless] Problem with xmlrpc over stacklesssocket
> To: "The Stackless Python Mailing List" <stackless at stackless.com>
> Date: Thursday, 23 September, 2010, 5:20
> On Tue, Sep 14, 2010 at 5:53 PM, Ray
> Gallagher <omyar_hunt at yahoo.co.uk>
> > Was wondering if you could point me in the right
> direction. Not sure if stacklesssocket is your project
> exactly though.
> > I'm having trouble with the basic python xmlrpc client
> over stacklesssocket. Basically, whenever I try to connect,
> the tasklet hangs. Other network protocols (basic http and
> memcache connections) seem to work fine. Also, the
> SimpleXMLRPCServer works fine under stacklesssocket. Seems
> to only be the xmlrpc client.
> > Anyone know how to tweak stacklesssocket to work with
> xmlrpc? I've attached runnable example code.
> Hi Ray,
> Your code appears to work fine for me. I am using an
> updated version
> of stackless socket, but the changes are superficial and
> only affect
> UDP related usage.
> The client consistently prints the following:
> Attempting to connect
> Connected to google
> Note that your server code should be cause for alarm, just
> by reading it:
> def run_server():
> server = SimpleXMLRPCServer(("localhost",
> 8888), allow_none=True)
> server.register_function(ping, "ping")
> The call in a tasklet to "serve_forever" implies you are
> invoking a
> framework. And indeed, looking at the implementation
> shows that this
> has an effect on any other tasklets:
> def serve_forever(self, poll_interval=0.5):
> while not
> w, e = select.select([self], , , poll_interval)
> Nothing within this yields to the scheduler. And
> additionally, it
> will block for half a second waiting for socket
> activity. If you use
> this without making it scheduler friendly, then you might
> as well not
> use any Stackless functionality on the server side.
> But back to the point, your code runs fine for me.
> Stackless mailing list
> Stackless at stackless.com
More information about the Stackless