From eabf4afb42e290fab9fd254a72841f8116a79835 Mon Sep 17 00:00:00 2001 From: ido Date: Sun, 2 Apr 2023 10:44:52 +0300 Subject: [PATCH] change sleep from 1 to 0 - sync between event loop to tasks --- README.md | 4 ++-- memphis/producer.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f43701c..083392e 100644 --- a/README.md +++ b/README.md @@ -280,8 +280,8 @@ consumer = await memphis.consumer( batch_max_time_to_wait_ms=5000, # defaults to 5000 max_ack_time_ms=30000, # defaults to 30000 max_msg_deliveries=10, # defaults to 10 - generate_random_suffix=False - start_consume_from_sequence=1 # start consuming from a specific sequence. defaults to 1 + generate_random_suffix=False, + start_consume_from_sequence=1, # start consuming from a specific sequence. defaults to 1 last_messages=-1 # consume the last N messages, defaults to -1 (all messages in the station) ) ``` diff --git a/memphis/producer.py b/memphis/producer.py index 222f137..2420410 100644 --- a/memphis/producer.py +++ b/memphis/producer.py @@ -168,8 +168,7 @@ async def produce( headers=headers, ) ) - # TODO - check why we need sleep in here - await asyncio.sleep(1) + await asyncio.sleep(0) except Exception as e: raise MemphisError(e) else: