[Zope-dev] Will ZServer help me in this scenario?

Amos Latteier amos@aracnet.com
Tue, 09 Mar 1999 10:13:43 -0800


At 05:01 PM 3/6/99 -0500, you wrote:
>
>    Skip> Will I need to make changes to Fredrik Lundh's XML-RPC code to
>    Skip> make this work?
>
>    Amos> I don't know much about this code, but I doubt it is causing any
>    Amos> concurrency issues or otherwise for you.
>
>I guess what I meant to say is will I need to modify the I/O that XML-RPC
>does to take advantage of Medusa's multi-threading I/O?

Hmm. If you want to do your I/O using async sockets, you'll need to do a
little digging. As someone mentioned, I think there's a start at that in
the medusa distribution, or at least in CVS.

>Alternatively, will
>not making a change reduce or eliminate the multi-threading?

I'm not sure I completely understand, but let me pose this scenario.
ZServer handles I/O between the browser and your published Python module.
It uses async  sockets. Your published module uses xmlrpc over vanilla
httplib to get some data from another server. Then the results are sent
back to the browser by ZServer.

This seems like the preferred solution to me. I can't think of any reason
not to do the above, and it would be much simpler than trying to figure out
how to use async sockets in your published module.

>Fredrik's
>xmlrpclib module uses vanilla httplib to communicate with the server.  Does
>loading asnycore/asynchat do something to fiddle with the I/O in standard
>packages or do you have to explicitly modify them to use it?

asyncore doesn't change your sockets, it just provides a framework to
handle them for you. So you won't have a problem if you decide to do some
socket communication without the framework. In fact in your case I suspect
that everything will flow much more sanely if you ignore asyncore and do
your socketing that way you're used to.

Good luck.

-Amos