[Zope] xml-rpc question
Paul Winkler
pw_lists@slinkp.com
Mon Aug 4 18:50:54 EDT 2003
On Mon, Aug 04, 2003 at 12:03:54PM -0400, Kevin Carlson wrote:
> Hi all,
>
> I need to run a python script called via xml-rpc that is kicked off by a
> cron job. This script will be making several dozen, perhaps over 100,
> different http requests to external servers, some of which can be quite
> slow on the return.
>
> I am curious to know if I am likely to receive a http timeout on this if
> the xml-rpc request takes a long time -- seems to me that that would
> happen.
It can happen. We get this sometimes when using zsyncer to sync large
amounts of stuff. It seems to depend on the client: IE seems to have its
own timeout, regardless of what the server does; whereas Mozilla
seems to be happy to wait for ages.
> Also, curious to know whether anyone has done something like
> this before and may know of a better way, perhaps using threads, or
> another mechanism that would let the xml-rpc call return (without a
> timeout) while the remainder of the work is being done. I'd like to
> avoid changing the timeout value on Apache since I don't want to change
> this across the board, if possible.
>
> Any ideas? Any known recipes out there?
I'm not clear - are you worried about each xml-rpc call timing out, or the
whole batch of them?
If the latter, you could just call RESPONSE.write() after
each xml-rpc call.
If the individual calls DO take too long, you might try
working with threads (tricky!). Or run it as a separate process,
which could be launched by an external method e.g. using os.system("command &")
to put the separate process in the background.
This way, the external method can return immediately.
--
Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ZOOMING INDEFATIGABLE HEATHEN POLAR BEAR!
(random hero from isometric.spaceninja.com)
More information about the Zope
mailing list