Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The most obvious is coroutines:

  def ping():
      while ping_channel.receive(): #blocks here
          print "PING"
          pong_channel.send("from ping")

  def pong():
      while pong_channel.receive():
          print "PONG"
          ping_channel.send("from pong")
Most of the things that he has in there don't need to be done with generators, though generators make it more efficient and arguably cleaner. However, sometimes generators are just a twisted workaround for controlling program flow. Channels and tasklets in Stackless express program flow very well, in my opinion.

You can see more of what stackless has to offer here: http://members.verizon.net/olsongt/stackless/why_stackless.h...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: