[Twisted-Python] xmlrpc protocoll instanze per connection?
petshmidt at googlemail.com
Thu Aug 5 10:21:04 EDT 2010
On Thu, Aug 5, 2010 at 3:32 PM, Alan Franzoni <mailing at franzoni.eu> wrote:
> On 8/4/10 1:30 PM, Pet wrote:
>> AFAIU this works only if Factory is subclassing
>> protocol.ServerFactory, XMLRPCFactory subclasses server.Site, where
>> protocol attribute is not present
> server.Site subclasses http.HTTPFactory which, in turns, subclasses
> by the way, if I now understand your question: just subclass XMLRPC and
> create your own xmlrpc resource class by adding methods like
> then add such handler to your server.Site, and you're done. Your method
> will be invoked once per request.
what I've tried to do is to have objects, which were members of
XMLRPC. And these objects would have some internal state which is
isolated per request. But each new request has changed this objects,
because xmlrpc is created once and not for each request or connection.
I've solved this by modifying render_POST where I create those objects
before calling requested function and so they lives only there without
being overwritten by new request. Ugh... It's might be ugly, but works
> Alan Franzoni
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python