diff --git a/doc/source/notifications.rst b/doc/source/notifications.rst index 62f02c7d..f59e3ac7 100644 --- a/doc/source/notifications.rst +++ b/doc/source/notifications.rst @@ -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 and plenty of other tasks. -To receive these notifications you should register a callback in -:py:class:`~taskflow.utils.misc.Notifier` provided by engine. -Each engine provides two of them: one notifies about flow state changes, -and another notifies about changes of tasks. +To receive these notifications you should register a callback with +an instance of the the :py:class:`notifier ` +class that is attached +to :py:class:`engine ` +attributes ``task_notifier`` and ``notifier``. -TaskFlow also has a set of predefined :ref:`listeners `, and +Taskflow also comes with a set of predefined :ref:`listeners `, and provides means to write your own listeners, which can be more convenient than using raw callbacks. diff --git a/taskflow/engines/base.py b/taskflow/engines/base.py index eb8d76ee..9255a3da 100644 --- a/taskflow/engines/base.py +++ b/taskflow/engines/base.py @@ -24,7 +24,13 @@ from taskflow.utils import misc @six.add_metaclass(abc.ABCMeta) 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): self._flow = flow