Diez B. Roggisch wrote:
> Hi,
>
> a few questions:
>
> > A shallow thread is just a generator modified in the most obvious
way
> > possible. The yield statement is replaced with a waitfor
expression.
> > You give it the object you wish to "wait for". Then when it's
ready
> > you get back a return
Hi,
a few questions:
> A shallow thread is just a generator modified in the most obvious way
> possible. The yield statement is replaced with a waitfor expression.
> You give it the object you wish to "wait for". Then when it's ready
> you get back a return value or an exception. These waitfo
Gary D. Duzan wrote:
>A while back I tossed something together to deal with the same
issue
> in terms of "futures" (or "promises".) Here is roughly what the
above
> code would look like with futures as I implemented them:
>This was all done using plain Python 1.5.2 in 80 lines of code,
In article <[EMAIL PROTECTED]>,
Rhamphoryncus <[EMAIL PROTECTED]> wrote:
>
>import mainloop, urllib
>
>def get_and_save(path):
>infile = waitfor urllib.urlopen(path, async=True)
>outfile = waitfor open(path.split('/')[-1], async=True)
>waitfor outfile.write(waitfor infile.read(async=Tru