-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
⚙️ documentationaffected functionality: documentationaffected functionality: documentation
Description
What kind of feature are you missing? Where do you notice a shortcoming of PTB?
Documentation on how to
- run multiple PTB bots in the same python process
- run PTB side-by-side with other asyncio frameworks in the same python process
is currently rather scarse.
Describe the solution you'd like
A section on the "Frequently requested design patterns" or even a standalone wiki page with some tips on these. Importants points are
- why
App.run_{polling, webhook}
are not suitable in these cases - Detailing which order to call
App.{initialize, start, stop, shutdown}
&Updater.start_{polling, webhook}
in - noting that cancelling pending tasks should be done after the app has shut down (see first bullet point in [BUG] Application gets stuck while manually stopping in async environment #3397 (comment))
- Some notes along the lines "there are many different design patterns for long-running asyncio processes, and there is probably not one right way for your use case"
Describe alternatives you've considered
No response
Additional context
- we already have the
Tip:
thingies in the docstrings ofApp.run_{polling, webhook}
, but that's apparently not enough customwebhookbot
showcases this to some extend but the "keep the process alive" part is conveniently covered by uvicorn andUpdater
is not included- There were several threads in the user-group where these topics were touched
- [BUG] Application gets stuck while manually stopping in async environment #3397
Metadata
Metadata
Assignees
Labels
⚙️ documentationaffected functionality: documentationaffected functionality: documentation