Turning f(callback) into a generator
Diez B. Roggisch
deets_noospaam at web.de
Wed Dec 3 18:26:13 EST 2003
More information about the Python-list mailing list
Wed Dec 3 18:26:13 EST 2003
- Previous message (by thread): Turning f(callback) into a generator
- Next message (by thread): Turning f(callback) into a generator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, > This is a strange asymmetry, and I was wondering if I've overlooked a > simple way to transform a callback into a generator, but I now tend to the > assumption that you *need* threads: One thread with the callback puts > names or name lists into the queue until it's full (some arbitrary limit > that also determines the total memory needed), another thread (the > generator) consumes names from the queue. I also thought about that - its the only thing that allows for real lazyness - you can wait in the callback until the generator clears a semaphore. But if the context-changes are worth the effort is questionable. Diez
- Previous message (by thread): Turning f(callback) into a generator
- Next message (by thread): Turning f(callback) into a generator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list