From daa5e88d6337cd428769f6b589452b17f9145601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 18 Nov 2018 23:24:35 +0100 Subject: [PATCH] Coroutine --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c8ed63c..1861dda 100644 --- a/README.md +++ b/README.md @@ -844,14 +844,19 @@ def eval_(node): Coroutine --------- -**• Similar to Generator, but Generator pulls data through the pipe with iteration, while Coroutine pushes data into the pipeline with send().** -**• Coroutines provide more powerful data routing possibilities than iterators. -**• If you built a collection of simple data processing components, you can glue them together into complex arrangements of pipes, branches, merging, etc.** +**• Similar to Generator, but Generator pulls data through the pipe with iteration, while Coroutine pushes data into the pipeline with send().** + +**• Coroutines provide more powerful data routing possibilities than iterators.** + +**• If you built a collection of simple data processing components, you can glue them together into complex arrangements of pipes, branches, merging, etc.** ### Helper Decorator -**• All coroutines must be "primed" by first calling .next()** -**• Remembering to call .next() is easy to forget.** -**• Solved by wrapping coroutines with a decorator:** +**• All coroutines must be "primed" by first calling .next()** + +**• Remembering to call .next() is easy to forget.** + +**• Solved by wrapping coroutines with a decorator:** + ```python def coroutine(func): def start(*args, **kwargs):