35. Emptying the channel def empty_channel(channel): print 'tasklets waiting:', channel.balance while channel.balance > 0: value = channel.receive() print 'received', value stackless.tasklet(empty_channel)(channel) stackless.run()
36. Idiom: Blocking out of the scheduler rapture_channel = stackless.channel() def wait_for_rapture(): rapture_channel.receive() def call_me_when_rapture_occurs(): while rapture_channel.balance < 0: rapture_channel.send(None)
37. What I have not covered <ul><li>Persistence of running code
38. Inter-thread channel usage.
39. C. </li></ul>
40. What you need to know <ul><li>You're on your own buddy... (almost) </li></ul>