Continuation Passing Style – Twisted

by JS

Is deferred a use of continuation passing style? In a sense.

continuation is a representation of some of the execution state of a program

Adding deferred callbacks defines a sequence of continuations. At each step, the deferred process calls the next function in the callback sequence using the data returned from the previous call. It’s not true CPS since the callbacks themselves don’t take continuations as parameters.

I like to think of it as CPS-light. Completely useless – until you need it.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Tumblr
  • Twitter