[Twisted-web] Re: Serving files from many web-servers thru one
db3l at fitlinxx.com
Wed Sep 29 08:45:00 MDT 2004
Thomas Weholt <thomas.weholt at gmail.com> writes:
> Sweet!!! I'm going to try it when I get off work. In my original
> design and implemented prototype the slave nodes on the subnet answers
> a UDP broadcast from the main server, which in turns keeps a list of
> slave-nodes on the local subnet, connecting to them and communicating
> with them using a mix of UDP and XMLRPC. Making a connection to the
> local slavenodes or adding them to the main server will be a bit more
> tricky using the code you supplied, but hey !!! If I can re-implement
> my idea using something like this it would be so much better.
Note that there's nothing that says you have to use PB to make the
internal requests. If you already have a working UDP/XMLRPC
mechanism, just go ahead and keep using it.
Any resource's render() operation can just return server.NOT_DONE_YET,
and then manage the request itself, completing it whenever it can,
deferrable or not. Just request.write() whatever data you eventually
want to, and don't forget to do the request.finish() when done. You
could just as easily make an XMLRPC request to an internal server from
within a render() as a callRemote to a PB server.
More information about the Twisted-web