Deferreds are values that might not exist yet
But callbacks are used for letting you know that values exist
Deferreds are objects — they can be passed about
Deferreds can be successful and fail — so we do not have to use sentinel values
Deferreds’ callback/errback can be chained
A failed callback/errback calls the next errback in the chain
A successful callback/errback calls the next callback in the chain
If you like being able to find your bugs finish your deferres with log.err
Use defer.succeed/defer.fail to make sure you’re always retunring the same type
Use maybeDeferred to make sure that your users are not paying for your infrastructure’s mistake
Like this: Like Loading...
This entry was posted on Sunday, March 15th, 2009 at 1:29 am and is filed under Uncategorized . You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response , or trackback from your own site.
Post navigation
« Previous Post
Next Post »