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

Interop with FastAPI #64

Open
strangemonad opened this issue Jan 22, 2024 · 2 comments
Open

Interop with FastAPI #64

strangemonad opened this issue Jan 22, 2024 · 2 comments

Comments

@strangemonad
Copy link

Thanks for this awesome project!

I know the main goal is actually to provide a stand-alone alternative but I'm curious if there's a way (or plans) to support interoperability with the FastAPI dependency system.

The main use case I can think of is the following:

  • In a larger code base, I want to be able to create some libraries that can be re-used in different contexts. E.g. a db package with connection pool setup dependencies. Sometimes that might be included in a fastapi app, other times a fast-stream app, other times a cli tool. I would like to be able to share the dependency configuration.
  • This is similar in spirit to how the guice or dagger dependency frameworks on the jvm allow you to create DI modules that can be composed and included (e.g. in a Spring boot or Jetty server).
@Lancetnik
Copy link
Owner

Lancetnik commented Jan 24, 2024

Thanks for your feedback and ideas! I really appreciate that!
For now FastDepends provides you with just a regular FastAPI Depends and serialization feauture, so I didn't plan a FastAPI compatibility due it already has it's own functional.

Also, FastDepends is not a really Dependency Injection library, it just a DI-like tool. But I had a lot of feedback and ideas about making FastDepends truly Dependency Injection system, so I have a big plan on it!

For now, I want to finish with FastStream reworking and improvements, then I am planning to refactor FastDepends as well to make it compatible-with-everнthing tool. But, it is not nearest future plans, sorry.

@strangemonad
Copy link
Author

@Lancetnik I think that order or priorities makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants