starting to write docs, taking decisions on public api
This commit is contained in:
18
examples/tutorial_basics_summary.py
Normal file
18
examples/tutorial_basics_summary.py
Normal file
@ -0,0 +1,18 @@
|
||||
from bonobo import Graph, ThreadPoolExecutorStrategy
|
||||
|
||||
|
||||
def yield_from(*args):
|
||||
yield from args
|
||||
|
||||
|
||||
# Represent our data processor as a simple directed graph of callables.
|
||||
graph = Graph(
|
||||
lambda: (x for x in ('foo', 'bar', 'baz')),
|
||||
str.upper,
|
||||
print, )
|
||||
|
||||
# Use a thread pool.
|
||||
executor = ThreadPoolExecutorStrategy()
|
||||
|
||||
# Run the thing.
|
||||
executor.execute(graph)
|
||||
Reference in New Issue
Block a user