xmlrpclib and generators

Hendrik van Rooyen mail at microcorp.co.za
Wed Jun 10 10:44:10 EDT 2009


Ken Seehart  wrote:

8< ------------ implementation --------------

>The practical constraints of my specific application are:
>1. The rpc server is a highly specialized slave system that does heavy duty
work.
>2. The rpc client is itself a web server that dispatches work requests to the
rpc server(s) and displays the >current status of work done so far.
>3. The generators will typically run for a long time (hours) and yield data
periodically (perhaps once a minute).

If this "yield" can be made to be, or if it is, supply side driven, instead of
yielding on demand like a
generator, then I would set up a simple TCP/IP peer to peer socket link and just
send the result
back when it is ready.  If you have to "serve" more than one such link, it is a
simple matter
to keep a list of queues linking the different socket sets to the "generator",
and to iterate over
the list, putting a copy of the thing that was just produced into each queue.

Of course, the thing you want to pass back must be serializable.

Have you looked at Pyro?

So my questions are:
1. Does using xmlrpc make any sense for this?

I think you are going to have to do some heavy lifting to get
it to work.

2. I am missing an easier way to do this?

Maybe - see above - depends on how the stuff is generated

3. Any good examples of things like this?

Don't know.

- Hendrik




More information about the Python-list mailing list