Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatcher should be stoppable and a async context manager #93

Open
llucax opened this issue Jan 6, 2025 · 0 comments
Open

Dispatcher should be stoppable and a async context manager #93

llucax opened this issue Jan 6, 2025 · 0 comments
Labels
part:dispatcher Affects the high-level dispatcher interface type:enhancement New feature or enhancement visitble to users

Comments

@llucax
Copy link
Contributor

llucax commented Jan 6, 2025

What's needed?

A more convenient way to allow application to automatically manage the dispatcher:

async with Dispatcher(...) as dispatcher:
    ...

Without having to manually start and stop the dispatcher, including when exceptions are raised.

Proposed solution

Inherit from BackgroundService. This also guarantees a common interface.

@llucax llucax added part:dispatcher Affects the high-level dispatcher interface type:enhancement New feature or enhancement visitble to users labels Jan 6, 2025
@llucax llucax changed the title Dispatcher should be a async context manager Dispatcher should be stoppable and a async context manager Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:dispatcher Affects the high-level dispatcher interface type:enhancement New feature or enhancement visitble to users
Projects
None yet
Development

No branches or pull requests

1 participant