[Twisted-Python] Learning Twisted

Glyph Lefkowitz glyph at divmod.com
Sun May 16 21:01:45 MDT 2004


Jason Diamond wrote:

> 
> However, the ircLogBot example [1], implies that calling self.join will 
> eventually invoke self.joined as if self.joined was the permanent 
> callback for calling self.join. I like your explanation for the 
> distinction between deferreds and methods but this seems to be blurring 
> the two. What happens if an error occurred while trying to join a 
> channel? (I'm not trying to pick anybody--I'm just trying to make sense 
> of the examples that I'm seeing.)
> 
> -- Jason
> 
> [1]
> http://twistedmatrix.com/documents/current/howto/clients#auto5

Aah, but that taps into the deep mystery of IRC.  The server can send 
you a 'joined' notification *even if you didn't previously request to 
join a channel*.  Also there is no particular way to hook up a join 
request and a join notification; if you request to join #foobar 3 times, 
and then you only get one notification of having joined, it's not clear 
which request gets the callback; commands are not tagged.

Of course this varies between IRC servers, too.

Better-specified protocols will tend to have better-specified interfaces 
that make use of Deferreds more.




More information about the Twisted-Python mailing list