📝 Feature: Implementation of the `AsyncContextManager` interface for `Application` (#3228)
Is your feature request related to a problem? Please describe.
Instead of
await app.start()
try:
...
finally:
await app.stop()
I want to do
async with app:
...
Describe the solution you'd like
Implementation of the
AsyncContextManager interface for ApplicationThis should work for
Application subclassses, i.e., for FastStream and AsgiFastStream.TestApp already has this capability. It just needs to be adjusted to use __aenter__ and __aexit__.Feature code example
async with app:
...
#enhancement #good_first_issue #faststream #ag2ai
sent via relator