Skip to content

Instantly share code, notes, and snippets.

@lukemarsden
Created September 23, 2011 22:43
Show Gist options
  • Save lukemarsden/1238656 to your computer and use it in GitHub Desktop.
Save lukemarsden/1238656 to your computer and use it in GitHub Desktop.
f = file(..)
nextChunk = True
def work():
while nextChunk is not None:
nextChunk = f.read(1024)
for thing in things:
thing.protocol.write(nextChunk)
yield
task = cooperate(work())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment