Re: [Twisted-Python] Deferred documentation.

2011-03-30 Thread Glyph Lefkowitz
On Mar 30, 2011, at 2:51 PM, Tristan Seligmann wrote: > On Wed, Mar 30, 2011 at 7:20 PM, Glyph Lefkowitz > wrote: >> However, in my experience, a novice's understanding of addCallbacks() is >> critically important to understanding other uses of Deferred as well; in >> particular, the "one chain

Re: [Twisted-Python] Deferred documentation.

2011-03-30 Thread Tristan Seligmann
On Wed, Mar 30, 2011 at 7:20 PM, Glyph Lefkowitz wrote: > However, in my experience, a novice's understanding of addCallbacks() is > critically important to understanding other uses of Deferred as well; in > particular, the "one chain of pairs of callback and errback" concept makes a > lot of the

Re: [Twisted-Python] Deferred documentation.

2011-03-30 Thread Glyph Lefkowitz
On Mar 30, 2011, at 11:09 AM, Christopher Armstrong wrote: > Funny, that's what I got on my proprietary application (0.0597) :-) It's a > heavily inlineCallbacks-based codebase, and I expect there would be a much > larger number of addCallback/addErrback calls if it weren't. Also, looking at >

Re: [Twisted-Python] Deferred documentation.

2011-03-30 Thread Jonathan Lange
On Wed, Mar 30, 2011 at 4:50 PM, Jasper St. Pierre wrote: > The problem that I have is that errback flow is awkward... the main > difference is that addCallbacks will call the errback if its own callback > fails, right? I can only see that really being useful by accident. > Not really. # 1. Hand

Re: [Twisted-Python] Deferred documentation.

2011-03-30 Thread Jasper St. Pierre
The problem that I have is that errback flow is awkward... the main difference is that addCallbacks will call the errback if its own callback fails, right? I can only see that really being useful by accident. On Wed, Mar 30, 2011 at 11:09 AM, Christopher Armstrong < ra...@twistedmatrix.com> wrote:

Re: [Twisted-Python] Deferred documentation.

2011-03-30 Thread Christopher Armstrong
On Wed, Mar 30, 2011 at 2:55 AM, Tristan Seligmann wrote: > On Tue, Mar 29, 2011 at 5:08 PM, Christopher Armstrong > wrote: > > I probably use addCallbacks once for every 30-100 addCallback or > addErrback > > calls I do (counted by lines of code, not times they're executed). But > > that's just

Re: [Twisted-Python] Deferred documentation.

2011-03-30 Thread Tristan Seligmann
On Tue, Mar 29, 2011 at 5:08 PM, Christopher Armstrong wrote: > I probably use addCallbacks once for every 30-100 addCallback or addErrback > calls I do (counted by lines of code, not times they're executed). But > that's just an off-the-cuff estimate. For interest's sake, I just ran the numbers

Re: [Twisted-Python] Deferred documentation.

2011-03-29 Thread Christopher Armstrong
On Tue, Mar 29, 2011 at 7:56 AM, Peter Hogg wrote: > I haven't been following the thread, but just wanted to mention > something that caught me out when I was learning to use deferreds. > > Both the old deferred documentation and your fix-up fail to mention > addCallbacks() until near the end, wh

Re: [Twisted-Python] Deferred documentation.

2011-03-29 Thread Jasper St. Pierre
Good catch, I really should mention that... On Tue, Mar 29, 2011 at 8:56 AM, Peter Hogg wrote: > I haven't been following the thread, but just wanted to mention > something that caught me out when I was learning to use deferreds. > > Both the old deferred documentation and your fix-up fail to me

Re: [Twisted-Python] Deferred documentation.

2011-03-29 Thread Peter Hogg
I haven't been following the thread, but just wanted to mention something that caught me out when I was learning to use deferreds. Both the old deferred documentation and your fix-up fail to mention addCallbacks() until near the end, when in practice I find addCallbacks() to be much more useful

Re: [Twisted-Python] Deferred documentation.

2011-03-28 Thread Jasper St. Pierre
I'm really tired... the 'demo server' program is at http://p.mecheye.net/deferred-server.py/0 I coded it up in like 10 minutes. Definition of quality right there, yo. Hopefully no more noise tonight. On Mon, Mar 28, 2011 at 9:14 PM, Jasper St. Pierre wrote: > I'm tired. Link dump: > > > http:/

Re: [Twisted-Python] Deferred documentation.

2011-03-28 Thread Jasper St. Pierre
I'm tired. Link dump: http://magcius.mecheye.net/twisted/DeferHowTo-Fixup.html http://magcius.mecheye.net/twisted/DeferHowTo-Fixup.lore oldies are at http://magcius.mecheye.net/twisted/DeferHowTo-Fixup-v1.html http://magcius.mecheye.net/twisted/DeferHowTo-Fixup-v1.lore comments, etc. __

Re: [Twisted-Python] Deferred documentation.

2011-03-28 Thread Jasper St. Pierre
OK, I'm already making a lot of these changes, I should have a new version Up Soon (TM). > Placeholders. > > Placeholders for what, though? > Placeholders for that magic lib, that I think I'm going to stop looking for and say, "demonstration purposes only" How do they use it? Why is it relevant

Re: [Twisted-Python] Deferred documentation.

2011-03-27 Thread Glyph Lefkowitz
On Mar 25, 2011, at 7:28 AM, Jasper St. Pierre wrote: > Big wall of text incoming. If you're going to read any part of this > email, search for *IMPORTANT* and read that part. > > Right now I'm stuck at creating a simple example for "deferred dependencies". > > On Tue, Mar 22, 2011 at 10:03 PM,

Re: [Twisted-Python] Deferred documentation.

2011-03-25 Thread Jasper St. Pierre
Big wall of text incoming. If you're going to read any part of this email, search for *IMPORTANT* and read that part. Right now I'm stuck at creating a simple example for "deferred dependencies". On Tue, Mar 22, 2011 at 10:03 PM, Glyph Lefkowitz wrote: > On Mar 21, 2011, at 9:30 PM, Jasper St. P

Re: [Twisted-Python] Deferred documentation.

2011-03-23 Thread Jasper St. Pierre
What about Mattel? http://itre.cis.upenn.edu/~myl/languagelog/archives/002892.html On Wed, Mar 23, 2011 at 1:07 PM, Glyph Lefkowitz wrote: > > On Mar 23, 2011, at 9:24 AM, Kevin Horn wrote: > > > On Tue, Mar 22, 2011 at 9:03 PM, Glyph Lefkowitz > wrote: >> >> Why is Twisted's right hand blue?  

Re: [Twisted-Python] Deferred documentation.

2011-03-23 Thread Glyph Lefkowitz
On Mar 23, 2011, at 9:24 AM, Kevin Horn wrote: > > > On Tue, Mar 22, 2011 at 9:03 PM, Glyph Lefkowitz > wrote: > Why is Twisted's right hand blue? (Forget about being a beginner: I honestly > don't even get this reference. Googling seems to suggest it has something to > do with symptoms o

Re: [Twisted-Python] Deferred documentation.

2011-03-23 Thread Albert Brandl
Hi! On Mon, Mar 21, 2011 at 09:30:54PM -0400, Jasper St. Pierre wrote: > http://magcius.mecheye.net/twisted/DeferHowTo-Rewrite.html > http://magcius.mecheye.net/twisted/DeferHowTo-Fixup.html This looks quite good. You might want to check if the code examples actually work, though: The "hands-on t

Re: [Twisted-Python] Deferred documentation.

2011-03-23 Thread Kevin Horn
On Tue, Mar 22, 2011 at 9:03 PM, Glyph Lefkowitz wrote: > >- Why is Twisted's right hand blue? (Forget about being a beginner: I >honestly don't even get this reference. Googling seems to suggest it has >something to do with symptoms of heart disease and doesn't seem funny or >re

Re: [Twisted-Python] Deferred documentation.

2011-03-22 Thread Glyph Lefkowitz
On Mar 21, 2011, at 9:30 PM, Jasper St. Pierre wrote: > On IRC, exarkun, glyph, spiv and idnar encouraged me to do a bit of > work on the Defer documentation. Yay! This documentation could definitely use some work. > I kept get confused between the things like returning a Deferred from a > cal

Re: [Twisted-Python] Deferred documentation.

2011-03-22 Thread Itamar Turner-Trauring
On Mon, 2011-03-21 at 21:30 -0400, Jasper St. Pierre wrote: > The former is a tutorial that I tried to make informal as possible, > and the latter is a fixup and rewrite of defer.xhtml stuff to make it > a bit less, uh, dense. I like the fixup, it's a good start, especially explaining the motivat

Re: [Twisted-Python] Deferred documentation.

2011-03-22 Thread Jasper St. Pierre
(I screwed up my mailman preferences accidentally, so this is formatted a bit haphazard from copy/paste) > Thank you for tackling the impossible. Thank you for the encouragement. I'm curious if you read both documents, and if you had a preference toward one or the other. I hopefully only want to

Re: [Twisted-Python] Deferred documentation.

2011-03-22 Thread Werner Thie
On 3/22/11 2:30 AM, Jasper St. Pierre wrote: > On IRC, exarkun, glyph, spiv and idnar encouraged me to do a bit of > work on the Defer documentation. I kept get confused between the > things like returning a Deferred from a callback and chainDeferred, > which I found out wasn't that useful: > > I

[Twisted-Python] Deferred documentation.

2011-03-21 Thread Jasper St. Pierre
On IRC, exarkun, glyph, spiv and idnar encouraged me to do a bit of work on the Defer documentation. I kept get confused between the things like returning a Deferred from a callback and chainDeferred, which I found out wasn't that useful: I suppose it's useful for "forking" a deferred you have a

Re: [Twisted-Python] Deferred documentation rewrite

2009-08-05 Thread Glyph Lefkowitz
On Mon, Aug 3, 2009 at 6:00 PM, Edward Z. Yang wrote: > I have updated my draft here: > >http://ezyang.com/twisted/defer2.html > Thanks. Looks like it's improving. I've got more points to critique now, but that's only because there's more meat to the tutorial now :). 1. The coding stan

Re: [Twisted-Python] Deferred documentation rewrite

2009-08-04 Thread Edward Z. Yang
Thanks! I've updated the docs accordingly. Cheers, Edward ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] Deferred documentation rewrite

2009-08-04 Thread Ying Li
In the Callbacks and errbacks section: "Notice that in the synchronous version, process is inside the try..except block. This translates over to the asynchronous code: if process throws an exception, handle_twisted will get a Failure object..." : I think you may mean "handle_twisted_error", not "ha

Re: [Twisted-Python] Deferred documentation rewrite

2009-08-04 Thread Don Dwiggins
Andrew Francis wrote: > Simple definition: In a synchronous call, the caller blocks until a result is > ready. Upon return the next statement is executed (barring something like an > exception). In an asynchronous call, the caller does not wait for a result > and continues. Just a thought on te

Re: [Twisted-Python] Deferred documentation rewrite

2009-08-04 Thread Andrew Francis
Hi Edward: Message: 2 Date: Mon, 03 Aug 2009 18:00:07 -0400 From: "Edward Z. Yang" Subject: Re: [Twisted-Python] Deferred documentation rewrite To: Twisted general discussion Message-ID: <1249336297-sup-7...@javelin> Content-Type: text/plain; charset=UTF-8 >Why callbacks

Re: [Twisted-Python] Deferred documentation rewrite

2009-08-03 Thread Dave Britton
- Original Message - From: "Edward Z. Yang" To: "Twisted general discussion" Sent: Monday, August 03, 2009 6:00 PM Subject: Re: [Twisted-Python] Deferred documentation rewrite I like the side-by-side regular and twisted versions, that's helpful

Re: [Twisted-Python] Deferred documentation rewrite

2009-08-03 Thread Edward Z. Yang
I have updated my draft here: http://ezyang.com/twisted/defer2.html The most notable change is I've removed the section "From Synchronous to Asynchronous". I believe (and I think other people agree with me) that this is an important topic to cover, but it's really *hard* to teach asynchronou

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-31 Thread Glyph Lefkowitz
On Fri, Jul 31, 2009 at 6:40 PM, Edward Z. Yang wrote: > You can view an initial draft of the rewrite here: This is a great first draft! Very substantial. I really appreciate you working on this. Now I will proceed to rip it to shreds by way of giving you some feedback, but please try to tak

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-31 Thread Itamar Shtull-Trauring
On Fri, 2009-07-31 at 18:40 -0400, Edward Z. Yang wrote: > You can view an initial draft of the rewrite here: > > http://ezyang.com/twisted/defer2.html > > For reference, this is the planned outline (X means done, ? means > almost done): > > X Synchronous to Asynchronous: The Method to the Madne

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-31 Thread Edward Z. Yang
You can view an initial draft of the rewrite here: http://ezyang.com/twisted/defer2.html For reference, this is the planned outline (X means done, ? means almost done): X Synchronous to Asynchronous: The Method to the Madness X Convert synchronous code to asynchronous code X Why asynchro

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-31 Thread Kevin Horn
On Fri, Jul 31, 2009 at 9:07 AM, Terry Jones wrote: > > "Michael" == Michael Hudson writes: > Michael> The accompanying paper is here: > http://mumak.net/stuff/twisted-intro.html > > I agree, that's a really nicely done document. It would be good to extend > it, moving into a description an

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-31 Thread Terry Jones
> "Michael" == Michael Hudson writes: Michael> The accompanying paper is here: http://mumak.net/stuff/twisted-intro.html I agree, that's a really nicely done document. It would be good to extend it, moving into a description and explanation of deferreds. Terry

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread Dave Britton
- Original Message - From: "Michael Hudson" To: "Twisted general discussion" The accompanying paper is here: http://mumak.net/stuff/twisted-intro.html Thanks for this incredibly helpful link! -Dave ___ Twisted-Python mailing list Twisted-Pyt

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread Nitro
Am 30.07.2009, 23:45 Uhr, schrieb Kevin Horn : > Thanks for this, Terry. I'd never thought of it that way, and it's > quite a > good point. I agree. I've come to think it's partially a fault of using normal text based editors. Those fit the programming models from 30 years ago well, but to

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread Michael Hudson
2009/7/31 ezyang : > Excerpts from Jamu Kakar's message of Thu Jul 30 15:03:16 -0400 2009: >> Jono Lange gave a presentation recently (can't remember what it was >> called... maybe something about being an evil hacker or about how >> your code sucks and he hates you) where he presented step-by-step

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread Kevin Horn
On Thu, Jul 30, 2009 at 4:27 PM, Terry Jones wrote: > > Right. Everything you could do synchronously, you can do asynchronously > > (and a bit more too). It just /looks/ really weird. > > At some point I realized that it helps to realize that code that looks > synchronous really isn't at all. P

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread Terry Jones
> Right. Everything you could do synchronously, you can do asynchronously > (and a bit more too). It just /looks/ really weird. At some point I realized that it helps to realize that code that looks synchronous really isn't at all. Probably all the programming that almost all of us will ever do

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread ezyang
Excerpts from Jamu Kakar's message of Thu Jul 30 15:03:16 -0400 2009: > Your outline looks nice. Something that *really* helped me a lot > with Deferreds was seeing how they are modelled after standard > Python flow control behaviour. I guess that's what the first > section your proposing is abou

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread Kevin Horn
This looks really great...looking forward to the results! Kevin Horn On Thu, Jul 30, 2009 at 2:03 PM, Jamu Kakar wrote: > Hi Edward, > > On Thu, Jul 30, 2009 at 11:24 AM, Edward Z. Yang wrote: > > I have been prodded by the members of #twisted into rewriting the > > Deferred documentation. You

Re: [Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread Jamu Kakar
Hi Edward, On Thu, Jul 30, 2009 at 11:24 AM, Edward Z. Yang wrote: > I have been prodded by the members of #twisted into rewriting the > Deferred documentation.  You can check out the plan at this > ticket: > > http://twistedmatrix.com/trac/ticket/3943 > > Comments would be appreciated. Your outl

[Twisted-Python] Deferred documentation rewrite

2009-07-30 Thread Edward Z. Yang
Hello all, I have been prodded by the members of #twisted into rewriting the Deferred documentation. You can check out the plan at this ticket: http://twistedmatrix.com/trac/ticket/3943 Comments would be appreciated. Cheers, Edward P.S. If you reply on the mailing list, please CC me. ___