Merge "Rework the overview of the notification mechanism"

This commit is contained in:
Jenkins
2014-05-25 00:14:57 +00:00
committed by Gerrit Code Review
2 changed files with 13 additions and 6 deletions

View File

@@ -16,12 +16,13 @@ Engines provide a way to receive notification on task and flow state
transitions, which is useful for monitoring, logging, metrics, debugging transitions, which is useful for monitoring, logging, metrics, debugging
and plenty of other tasks. and plenty of other tasks.
To receive these notifications you should register a callback in To receive these notifications you should register a callback with
:py:class:`~taskflow.utils.misc.Notifier` provided by engine. an instance of the the :py:class:`notifier <taskflow.utils.misc.Notifier>`
Each engine provides two of them: one notifies about flow state changes, class that is attached
and another notifies about changes of tasks. to :py:class:`engine <taskflow.engines.base.EngineBase>`
attributes ``task_notifier`` and ``notifier``.
TaskFlow also has a set of predefined :ref:`listeners <listeners>`, and Taskflow also comes with a set of predefined :ref:`listeners <listeners>`, and
provides means to write your own listeners, which can be more convenient than provides means to write your own listeners, which can be more convenient than
using raw callbacks. using raw callbacks.

View File

@@ -24,7 +24,13 @@ from taskflow.utils import misc
@six.add_metaclass(abc.ABCMeta) @six.add_metaclass(abc.ABCMeta)
class EngineBase(object): class EngineBase(object):
"""Base for all engines implementations.""" """Base for all engines implementations.
:ivar notifier: A notification object that will dispatch events that
occur related to the flow the engine contains.
:ivar task_notifier: A notification object that will dispatch events that
occur related to the tasks the engine contains.
"""
def __init__(self, flow, flow_detail, backend, conf): def __init__(self, flow, flow_detail, backend, conf):
self._flow = flow self._flow = flow