@@ -69,17 +69,19 @@ A (sometimes) nicer syntax is provided for adding callbacks, with the
6969 yield Effect(Print(" Hello," , name))
7070
7171 Finally, to actually perform these effects, they can be passed to
72- :func: `effect.perform `, along with a dispatcher which looks up the performer
73- based on the intent.
72+ :func: `effect.sync_perform `, along with a dispatcher which looks up the
73+ performer based on the intent.
7474
7575.. code :: python
7676
77+ from effect import sync_perform
78+
7779 def main ():
7880 eff = greet()
7981 dispatcher = ComposedDispatcher([
8082 TypeDispatcher({ReadLine: perform_read_line}),
8183 base_dispatcher])
82- perform (dispatcher, eff)
84+ sync_perform (dispatcher, eff)
8385
8486 This has a number of advantages. First, your unit tests for ``get_user_name ``
8587become simpler. You don't need to mock out or parameterize the ``raw_input ``
@@ -115,7 +117,8 @@ A quick tour, with definitions
115117- Box: An object that has ``succeed `` and ``fail `` methods for providing the
116118 result of an effect (potentially asynchronously). Usually you don't need
117119 to care about this, if you define your performers with
118- :func: `effect.sync_performer ` or :func: `effect.twisted.deferred_performer `.
120+ :func: `effect.sync_performer ` or ``txeffect.deferred_performer `` from the
121+ `txeffect `_ package.
119122
120123There's a few main things you need to do to use Effect.
121124
@@ -126,11 +129,12 @@ There's a few main things you need to do to use Effect.
126129 ``Effect(HTTPRequest(...)) `` and attach callbacks to them with
127130 :func: `Effect.on `.
128131- As close as possible to the top-level of your application, perform your
129- effect(s) with :func: `effect.perform `.
130- - You will need to pass a dispatcher to :func: `effect.perform `. You should create one
131- by creating a :class: `effect.TypeDispatcher ` with your own performers (e.g. for
132- ``HTTPRequest ``), and composing it with :obj: `effect.base_dispatcher ` (which
133- has performers for built-in effects) using :class: `effect.ComposedDispatcher `.
132+ effect(s) with :func: `effect.sync_perform `.
133+ - You will need to pass a dispatcher to :func: `effect.sync_perform `. You should
134+ create one by creating a :class: `effect.TypeDispatcher ` with your own
135+ performers (e.g. for ``HTTPRequest ``), and composing it with
136+ :obj: `effect.base_dispatcher ` (which has performers for built-in effects)
137+ using :class: `effect.ComposedDispatcher `.
134138
135139
136140Callback chains
0 commit comments