Skip to content

Commit

Permalink
Use callbacks instead of d.result
Browse files Browse the repository at this point in the history
Just to make @glyph happy
  • Loading branch information
lvh committed Aug 8, 2014
1 parent 582e06a commit 076d4d5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.rst
Expand Up @@ -51,9 +51,13 @@ When accessing a method named in the list, you get an object wrapping
it instead. Calling it returns a Deferred. Any arguments passed are
passed verbatim to the wrapped method.

>>> d = car_thimble.drive_to("work")
>>> d.result
'driven to work'
>>> def print_(s):
... # can't use from __future__ import print_function because of a
... # doctest limitation :-(
... print s

>>> d = car_thimble.drive_to("work").addCallback(print_)
driven to work

This Deferred has already fired synchronously, because we're using a
fake thread pool and reactor.
Expand Down

0 comments on commit 076d4d5

Please sign in to comment.