Add simple_linear_listening
example to generated docs
This one is a nice to have in the examples, and should also be updated to not use deprecated properties. Change-Id: I5ee754525caccf0a9ea2a2b00aaa4e0d305e55b7
This commit is contained in:
@@ -34,6 +34,18 @@ Using listeners
|
|||||||
:linenos:
|
:linenos:
|
||||||
:lines: 16-
|
:lines: 16-
|
||||||
|
|
||||||
|
Using listeners (to watch a phone call)
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Full source located at :example:`simple_linear_listening`.
|
||||||
|
|
||||||
|
.. literalinclude:: ../../taskflow/examples/simple_linear_listening.py
|
||||||
|
:language: python
|
||||||
|
:linenos:
|
||||||
|
:lines: 16-
|
||||||
|
|
||||||
Dumping a in-memory backend
|
Dumping a in-memory backend
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
@@ -92,11 +92,11 @@ engine = taskflow.engines.load(flow, store={
|
|||||||
})
|
})
|
||||||
|
|
||||||
# This is where we attach our callback functions to the 2 different
|
# This is where we attach our callback functions to the 2 different
|
||||||
# notification objects that an engine exposes. The usage of a '*' (kleene star)
|
# notification objects that an engine exposes. The usage of a ANY (kleene star)
|
||||||
# here means that we want to be notified on all state changes, if you want to
|
# here means that we want to be notified on all state changes, if you want to
|
||||||
# restrict to a specific state change, just register that instead.
|
# restrict to a specific state change, just register that instead.
|
||||||
engine.notifier.register(ANY, flow_watch)
|
engine.notifier.register(ANY, flow_watch)
|
||||||
engine.task_notifier.register(ANY, task_watch)
|
engine.atom_notifier.register(ANY, task_watch)
|
||||||
|
|
||||||
# And now run!
|
# And now run!
|
||||||
engine.run()
|
engine.run()
|
||||||
|
Reference in New Issue
Block a user