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

fix: fastapi lifespan management with multiple apps at once #241

Conversation

FabienArcellier
Copy link
Collaborator

@FabienArcellier FabienArcellier commented Feb 14, 2024

When streamsync is run by a FastAPI application as a subapplication, its kernel does not start. FastAPI ignores the lifespan associated with a sub-application. It fix #213 & #186.

The documentation Multiple apps at once is currently broken.

This PR provides a helper streamsync.serve.lifespan for the FastAPI application that scans apps mounted in FastAPI and identifies which are streamsync instances. The kernel of each application is started.

Peek 2024-02-14 20-53

* introduce streamsync.serve.lifespan to gather lifespan of different streamsync application
@FabienArcellier FabienArcellier changed the title fastapi lifespan management with multiple apps at once fix: fastapi lifespan management with multiple apps at once Feb 14, 2024
@FabienArcellier FabienArcellier added the bug Something isn't working label Feb 14, 2024
@ramedina86
Copy link
Collaborator

Incredible work with solid tests 💯

@ramedina86 ramedina86 merged commit 34de1e9 into writer:dev Feb 14, 2024
12 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants