Re: [Twisted-Python] Small practice application

2010-09-29 Thread Zubin Mithra
> > Hi everyone, > > I've decided to write a Tic-Tac-Toe gameserver and client(no biggie, just > for getting used to twisted as I'm pretty new to it). The gameserver > facilitates the connection between two clients and maintains the game state. > > I'm having trouble deciding how to create factorie

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread exarkun
On 12:52 am, ch...@simplistix.co.uk wrote: > >Because I haven't found any permutation that doesn't result in the >LoopingCall's calls to `loop` from stopping after the exception. > >I would be more than ecstatic to be proved wrong ;-) You keep saying the LoopingCall stops. It does not stop. It i

[Twisted-Python] Small practice application

2010-09-29 Thread Zubin Mithra
Hi everyone, I've decided to write a Tic-Tac-Toe gameserver and client(no biggie, just for getting used to twisted as I'm pretty new to it). The gameserver facilitates the connection between two clients and maintains the game state. I'm having trouble deciding how to create factories and protocol

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread Chris Withers
On 30/09/2010 00:31, Glyph Lefkowitz wrote: > > There are so many ways. Yes, that's what I thought, which is why I was confused to keep on getting "fix the code" responses when I'd already pointed out it wasn't my code to fix, and I'd like to build a solution that caters even for this eventuall

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread Glyph Lefkowitz
On Sep 29, 2010, at 6:56 PM, Chris Withers wrote: > On 29/09/2010 22:06, exar...@twistedmatrix.com wrote: >>> That's one side of things, sure, but how can I write a scheduler which >>> handles the current situation? >> >> Beats me. > > So, if some buggy code that should be doing a deferred call

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread Chris Withers
On 29/09/2010 22:06, exar...@twistedmatrix.com wrote: >> That's one side of things, sure, but how can I write a scheduler which >> handles the current situation? > > Beats me. So, if some buggy code that should be doing a deferred callback/errback instead raises an exception, you're basically scr

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread exarkun
On 08:27 pm, ch...@simplistix.co.uk wrote: >On 29/09/2010 18:31, exar...@twistedmatrix.com wrote: >>Then you're talking about an API in Twisted which returns a Deferred >>that sometimes doesn't errback when the implementation encounters an >>error. >> >>Also, `failIfNotConnected` should never raise

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread Chris Withers
On 29/09/2010 18:31, exar...@twistedmatrix.com wrote: > Then you're talking about an API in Twisted which returns a Deferred > that sometimes doesn't errback when the implementation encounters an > error. > > Also, `failIfNotConnected` should never raise an exception. > > These sound like bugs. > >

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

2010-09-29 Thread Jonathan Lange
On Wed, Sep 29, 2010 at 6:40 PM, ruslan usifov wrote: > If we stop listening, how can i wait while all client connection (which was > accepted before stopListening) processed and then call reactor.stop? > In your factory, keep a count of the number of clients you have and whether stopListening ha

Re: [Twisted-Python] Unable to start twistd service on Ubuntu 10.04 when using pseudo terminal

2010-09-29 Thread Garret Heaton
I've simplified this issue down and am able to reproduce it without Twisted: http://gist.github.com/603154 Still not sure what the cause is, so if anyone has any ideas I'd love to hear them. Thanks! On Mon, Sep 27, 2010 at 8:15 PM, Garret Heaton wrote: > To me this seems like a very strange pro

[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] how to write a safe catch-all

2010-09-29 Thread exarkun
On 05:16 pm, ch...@simplistix.co.uk wrote: >On 29/09/2010 17:16, Phil Mayers wrote: >>No. >> >>The problem is that your example is malformed. > >Well, it's not, it's the reality of the situation and one I'd like to >protect against; "the scheduler must not die" is the rule I need to >make >work...

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread Chris Withers
On 29/09/2010 17:16, Phil Mayers wrote: > No. > > The problem is that your example is malformed. Well, it's not, it's the reality of the situation and one I'd like to protect against; "the scheduler must not die" is the rule I need to make work... > You do this: > >1. Create a deferred on t

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread Phil Mayers
On 29/09/10 16:56, Chris Withers wrote: > On 28/09/2010 15:21, exar...@twistedmatrix.com wrote: >>> But, more crucially, the looping call then appears to stop. >> >> The function you're looping over returns a Deferred that never fires. >> The LoopingCall isn't stopped, it's waiting for the Deferred

Re: [Twisted-Python] how to write a safe catch-all

2010-09-29 Thread Chris Withers
On 28/09/2010 15:21, exar...@twistedmatrix.com wrote: >> But, more crucially, the looping call then appears to stop. > > The function you're looping over returns a Deferred that never fires. > The LoopingCall isn't stopped, it's waiting for the Deferred. So, inlineCallbacks/generator things will o