===================== The Pattern in Python ===================== .. code-block:: python from typing import Callable import e2c Configuration via DSL ===================== The configuration determines the data flow. .. code-block:: python config = ( '.run -- action', 'action.render -- render', 'action.store -- store') Actors ====== Each function represents an actor. .. code-block:: python def action(data, render, store): render(data) print('%s in action' % data) store(1, data) def render(data:str): print('%s in render' % data) def store(id: int, data:str): print('%s and %d in store' % (data, id)) Graph ======= .. code-block:: python graph = e2c.Graph(config) graph.actor('action', action) graph.actor('render', render) graph.actor('store', store) Visualize ========= .. code-block:: python graph.visualize() .. image:: /_static/quickstart2.png :align: center Run the flow ============ .. code-block:: python graph.run("Hello") .. code-block:: bash $ Hello in render $ Hello in action $ Hello and 1 in store