Friday, February 19, 2010

Deferred Reference



This document is a guide to the behaviour of the twisted.internet.defer.Deferred object, and to various ways you can use them when they are returned by functions.

This document assumes that you are familiar with the basic principle that the Twisted framework is structured around: asynchronous, callback-based programming, where instead of having blocking code in your program or using threads to run blocking code, you have functions that return immediately and then begin a callback chain when data is available.

After reading this document, the reader should expect to be able to deal with most simple APIs in Twisted and Twisted-using code that return Deferreds.

* what sorts of things you can do when you get a Deferred from a function call; and
* how you can write your code to robustly handle errors in Deferred code

1 comment:

  1. reference = http://twistedmatrix.com/documents/current/core/howto/defer.html#auto12

    ReplyDelete