[Twisted-Python] reactor.stop if no any clients

2010-09-29 Thread ruslan usifov
If we stop listening, how can i wait while all client connection (which was accepted before stopListening) processed and then call reactor.stop? ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/list

Re: [Twisted-Python] Graceful/Hitless restart

2010-09-23 Thread ruslan usifov
I know, i have simply hope that anybody solved a similar problem and could share source codes :-))) This is application-specific behavior that you'll have to implement > yourself. > > Jean-Paul > > ___ > Twisted-Python mailing list > Twisted-Python@twis

Re: [Twisted-Python] Graceful/Hitless restart

2010-09-23 Thread ruslan usifov
Hello First of all sorry for my bad english I don't think that this tikeе suit fro me:-( When i said Graceful i mean net behaviour: 1). Server doesn't break already connected clients. Wait while they all ends and only afte then dies 2). Respawn new workers with new reread config, which will se

[Twisted-Python] Graceful/Hitless restart

2010-09-22 Thread ruslan usifov
Hello! Sorry for my bad English! Can anybody provide some samples how to implement Graceful restart in twisted? Thanks ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] file descriptor cannot be a negative integer (-1)

2010-09-22 Thread ruslan usifov
ok i provide sample till the end of this week 2010/9/20 Glyph Lefkowitz > > On Sep 20, 2010, at 10:34 AM, ruslan usifov wrote: > > I implement specific proxy server, so after analyze i think that this > happens if client disconnected from server, but server already made > con

Re: [Twisted-Python] file descriptor cannot be a negative integer (-1)

2010-09-20 Thread ruslan usifov
be a negative integer (-1)" So this looks like my bug 2010/9/20 Glyph Lefkowitz > > On Sep 17, 2010, at 8:21 PM, ruslan usifov wrote: > > Its a simply fastcgi proxy, which reads all request(analize it, do some > pending things and then proxy request to real worker) > >

Re: [Twisted-Python] how to implement sleep?

2010-09-19 Thread ruslan usifov
Can you provide some code to use it? In maner like protocol.ClientCreator? Perhaps you want ReconnectingClientFactory ? Set maxRetries to 3. See > twisted.internet.protocols.ReconnectingClientFactory. > > > -- > Regards, > Stephen Thorne > Development Engineer > Netbox Blue > > __

[Twisted-Python] how to implement sleep?

2010-09-19 Thread ruslan usifov
Hello Twisted is great, but how cant i emulate sleep behaviour in syested. I know that exists callLater, but how to use it in yield scenario, like here: @inlineCallbacks def work(self): l_attempts = 0; while l_attemps < 3: try: resp = yield break;

Re: [Twisted-Python] file descriptor cannot be a negative integer (-1)

2010-09-17 Thread ruslan usifov
Sorry fo my question. I'm new in twisted ad may misunderstand some things:-), and my questions may look like trivial I have follow stack trace: cant connect to fcgi socket: [Failure instance: Traceback: : file descriptor can not be a negative integer (-1) /usr/local/lib/python2.6/site-packages/tw

[Twisted-Python] file descriptor cannot be a negative integer (-1)

2010-09-17 Thread ruslan usifov
Hello! I have use kqreactor from this branch http://twistedmatrix.com/trac/browser/branches/kqreactor-1918-3/. In the follow code we connect to unix socket. Sometimes we got the error: "file descriptor cannot be a negative integer (-1)" what does this mean? I haven't any ideas l_client = protocol

[Twisted-Python] kqueue reactor

2010-09-14 Thread ruslan usifov
Which kqueue reactor in twisted is best? Twisted have kqreactor - but it need PyKQueue patched version, and PyKQueue doesn't supported Also i found https://trac.calendarserver.org/browser/CalendarServer/branches/users/glyph/use-system-twisted/kqreactor.py, but doesn't known is it possible use in

Re: [Twisted-Python] multiple workers

2010-09-02 Thread ruslan usifov
Why it is not supported? I want behaviour like nginx http://nginx.org/, and misunderstand why i can't implemented it throw twisted. Its' so easy. Every process have it's own set sockets, and they doesn't share this sockets between each other. "OnConnect" event happens only once and which process h

[Twisted-Python] multiple workers

2010-09-01 Thread ruslan usifov
Hello I try to write twisted based daemon that work in multiple workers, like this: from twisted.internet import reactor; from proxy import FASTCGIServerProxyFactory; import os; reactor.listenUNIX("/tmp/twisted-fcgi.sock", FASTCGIServerProxyFactory()); for i in xrange(3): l_pid = os.fork();