A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/346912.html below:

global interpreter lock

global interpreter lock global interpreter lockStephen Thorne stephen.thorne at gmail.com
Wed Sep 14 22:46:32 EDT 2005
On 15/09/05, Michael Sparks <ms at cerenity.org> wrote:
> At the moment, one option that springs to mind is this:
>     yield WaitDataAvailable("inbox")

Twisted supports this.

help("twisted.internet.defer.waitForDeferred")

example usage is:

@deferredGenerator
def thingummy():
  thing = waitForDeferred(makeSomeRequestResultingInDeferred())
  yield thing
  thing = thing.getResult()
  print thing #the result! hoorj!

With the new generator syntax, it becomes somewhat less clunky,
allowing for the syntax:

@defgen
def foo():
   somereturnvalue = yield SomeLongRunningOperation()
   print somereturnvalue

http://svn.twistedmatrix.com/cvs/sandbox/radix/newdefgen.py?view=markup&rev=14348

-- 
Stephen Thorne
Development Engineer

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4