[Twisted-Python] Configuring Twisted logging via plugins

2010-08-04 Thread Valeriy Zamarayev
Hello, all. There have been a few questions on this list about how to configure Twisted logging via plugins, as opposed to .tac files. And we now know about the #638 and #3534 tickets. Hopefully, they will be resolved soon. But before this happens, it seems to me there's no other way to handle th

[Twisted-Python] service stops/twistd exits

2010-08-04 Thread Thomas Drake
Hello, I'm wondering if there is an established pattern for having an application running in twistd shut itself down in the absence of a running service? The idea is that if a service fails it calls self.stopService() and the application shuts itself down somehow (rather than having the service c

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-04 Thread Itamar Turner-Trauring
On Wed, 2010-08-04 at 14:59 +0200, Pet wrote: > That make sense, thanks. Is there a way to isolate requests from each other? Each call to Resource.render() (which in this case then calls XMLRPC.xmlrpc_) is a separate request. ___ Twisted-Python mailin

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-04 Thread Pet
On Wed, Aug 4, 2010 at 2:13 PM, Itamar Turner-Trauring wrote: > On Wed, 2010-08-04 at 12:00 +0200, Pet wrote: > >> Now, for XMLRPC this looks for me like Protocol instance is reused for >> all connection. If it is so, can I change this behavior, so I have one >> instance of Protocol per connection

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-04 Thread Itamar Turner-Trauring
On Wed, 2010-08-04 at 12:00 +0200, Pet wrote: > Now, for XMLRPC this looks for me like Protocol instance is reused for > all connection. If it is so, can I change this behavior, so I have one > instance of Protocol per connection? XMLRPC is a Resource, not a Protocol: Resources handle HTTP *reque

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-04 Thread Pet
On Wed, Aug 4, 2010 at 12:25 PM, Alan Franzoni wrote: > Just ovverride the "protocol" attribute on your factory with the > callable you want to be called when a new protocol needs to be Hello Alan, AFAIU this works only if Factory is subclassing protocol.ServerFactory, XMLRPCFactory subclasses s

Re: [Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-04 Thread Alan Franzoni
Just ovverride the "protocol" attribute on your factory with the callable you want to be called when a new protocol needs to be instanced. I'd suppose you'd probably want to subclass HTTPChannel or something like that. ___ Twisted-Python mailing list

[Twisted-Python] xmlrpc protocoll instanze per connection?

2010-08-04 Thread Pet
Hello, I've started learning twisted by implementing linereceiver, where for each new connection a new instance of MyProtocol is created: class MyFactory(protocol.ServerFactory): protocol = MyProtocol def __init__(self): self.db = adbapi.ConnectionPool() class MyService(internet.