[Twisted-Python] fetchmany and deferreds which call back more than once

Clark C. Evans cce at clarkevans.com
Tue Mar 4 16:01:20 EST 2003


Thank you for your suggestion.  Although this is nice, I was
looking for more of a cooked solution that builds on the
deferred mechanism.  For example, the mechanism you have 
doesn't really handle the case of chaining the callbacks
or any of the other nice aspects of the Deferred object.



On Tue, Mar 04, 2003 at 09:38:37AM +0200, Tommi Virtanen wrote:
| 	Here's what I've done, with LDAP queries that can
| 	return arbitrarily many results:
| 	http://tv.debian.net/software/ldaptor/api/public/ldaptor.pro
| tocols.ldap.ldapsyntax.LDAPObject-class.html#search
| 	Basically, you can either pass a callback to search() that
| 	will be called once per result, or if you don't pass one,
| 	it'll gather all the results into a list. The Deferred you
| 	get either evaluates to None or to a list of results,
| 	depending on whether you passed the callback or not.

More information about the Twisted-Python mailing list