From 932b44fac17ac656b19861f68601d0ba4fe642d1 Mon Sep 17 00:00:00 2001 From: Andrey Koltsov Date: Tue, 17 Nov 2020 11:32:18 +0100 Subject: [PATCH] make doc consistent --- README.rst | 2 +- docs/includes/intro.txt | 2 +- docs/userguide/streams.rst | 4 ++-- docs/userguide/testing.rst | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 78240634e..b7eb20dd1 100644 --- a/README.rst +++ b/README.rst @@ -53,7 +53,7 @@ Here's an example processing a stream of incoming orders: amount: int @app.agent(value_type=Order) - async def order(orders): + async def process_order(orders): async for order in orders: # process infinite stream of orders. print(f'Order for {order.account_id}: {order.amount}') diff --git a/docs/includes/intro.txt b/docs/includes/intro.txt index 9c965f1a9..0ecee5ee3 100644 --- a/docs/includes/intro.txt +++ b/docs/includes/intro.txt @@ -29,7 +29,7 @@ Here's an example processing a stream of incoming orders: amount: int @app.agent(value_type=Order) - async def order(orders): + async def process_order(orders): async for order in orders: # process infinite stream of orders. print(f'Order for {order.account_id}: {order.amount}') diff --git a/docs/userguide/streams.rst b/docs/userguide/streams.rst index 6e4d92106..7207d8825 100644 --- a/docs/userguide/streams.rst +++ b/docs/userguide/streams.rst @@ -310,7 +310,7 @@ stream by taking a "key type" as argument: orders_topic = app.topic('orders', value_type=Order) @app.agent(orders_topic) - async def process(orders): + async def process_order(orders): async for order in orders.group_by(Order.account_id): ... @@ -338,7 +338,7 @@ the data in streams you can manually extract the key used for repartitioning: return json.loads(order)['account_id'] @app.agent(app.topic('order')) - async def process(orders): + async def process_order(orders): async for order in orders.group_by(get_order_account_id): ... diff --git a/docs/userguide/testing.rst b/docs/userguide/testing.rst index b055507fc..3361147d1 100644 --- a/docs/userguide/testing.rst +++ b/docs/userguide/testing.rst @@ -33,7 +33,7 @@ To test an agent when unit testing or functional testing, use the special orders_for_account = app.Table('order-count-by-account', default=int) @app.agent(orders_topic) - async def order(orders): + async def process_order(orders): async for order in orders.group_by(Order.account_id): orders_for_account[order.account_id] += 1 yield order