{"categories":[{"label":"Networking","url":"https://skillfed.io/packages/category/system-networking"}],"enrichment":{"capability":"Integrates FastAPI request and dependency injection into taskiq distributed tasks, allowing task functions to depend on FastAPI Request objects and shared application state.","skillfed_tags":["fastapi-integration","task-queue","dependency-injection"],"use_cases":["Share a database connection pool or Redis client between FastAPI endpoints and background tasks using the same dependency function.","Inject application configuration or secrets into task functions without passing them as explicit parameters.","Reuse FastAPI middleware-like logic (authentication, logging, tracing) in distributed task workers.","Set up integration tests with InMemoryBroker by manually populating the dependency context for both FastAPI and taskiq.","Build microservices where FastAPI handles HTTP requests and taskiq handles async work, both accessing the same application state."],"what_it_does":"taskiq-fastapi bridges FastAPI's dependency injection system with taskiq's distributed task queue. It allows task functions to depend on FastAPI Request objects and access application state (like database pools or configuration) that would normally only be available in HTTP handlers. The library works by injecting a worker-wide Request object at task startup, letting you reuse the same dependency functions across both FastAPI endpoints and taskiq tasks.\n\nThe package is designed for scenarios where you want to share business logic between synchronous HTTP handlers and asynchronous background tasks without duplicating dependency resolution. It requires explicit use of TaskiqDepends (rather than FastAPI's Depends) in task signatures so the taskiq resolver knows to inject dependencies. The documentation warns that the injected Request is a synthetic object created at worker startup, not tied to any actual HTTP request, and requires careful handling of broker startup/shutdown to avoid infinite recursion.","worth_installing":"Yes, if you are already using both FastAPI and taskiq and want to share dependency injection logic between them. The low install friction, permissive license, and active maintenance make it a reasonable choice. Be aware it is classified as Alpha, so expect potential API changes. Verify that the synthetic Request object meets your dependency needs before committing to production use."},"id":"taskiq-fastapi","links":{"html":"https://skillfed.io/packages/taskiq-fastapi","md":"https://skillfed.io/packages/taskiq-fastapi.md","pypi":"https://pypi.org/project/taskiq-fastapi/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-18","license_spdx":"MIT","license_treatment":"permissive","name":"taskiq-fastapi","python_support":"supports_current","summary":"FastAPI integration for taskiq"},"popularity":{"monthly_downloads":225315,"position":9222,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.5.0"}
