mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-24 16:17:37 +01:00
Updated Concurrency (markdown)
parent
2dcb668cee
commit
009111b83c
1 changed files with 2 additions and 2 deletions
|
@ -43,7 +43,7 @@ async def process_update(self, update):
|
|||
if handler.check_update(update):
|
||||
# Here we `await`, i.e. we only continue after the callback is done!
|
||||
await handler.handle_update(update)
|
||||
continue # at most one handler per group handles the update
|
||||
break # at most one handler per group handles the update
|
||||
```
|
||||
|
||||
## Using concurrency
|
||||
|
@ -77,7 +77,7 @@ async def process_update(self, update):
|
|||
if handler.check_update(update):
|
||||
# Here we *don't* `await`, such that the loop immediately continues
|
||||
asyncio.create_task(handler.handle_update(update))
|
||||
continue # at most one handler per group handles the update
|
||||
break # at most one handler per group handles the update
|
||||
```
|
||||
|
||||
This already helps for many use cases.
|
||||
|
|
Loading…
Reference in a new issue