feat(service): add service composition primitives#722
Draft
cofin wants to merge 1 commit into
Draft
Conversation
cofin
force-pushed
the
feat/service-composition-utility-extraction
branch
from
May 24, 2026 04:15
8d65e56 to
204887d
Compare
cofin
force-pushed
the
feat/service-composition-core-composition
branch
from
May 24, 2026 04:15
7f561b6 to
3cf18d5
Compare
cofin
force-pushed
the
feat/service-composition-core-composition
branch
from
May 25, 2026 16:03
3cf18d5 to
866b4a9
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
ServiceComposition[Unpack[Ts]]for typed async service composition on a caller-owned sessionServiceProviderandServiceWithSessiontyping primitivesadvanced_alchemy.serviceStack
litestar-org:feat/service-composition-utility-extractionat204887ddlitestar-org:feat/service-composition-core-compositionat3cf18d5av1.10.0release and refactor: extract provider dependency utilities #721 branch rebuildadvanced-alchemy-4vbNotes
composition.pyuses a local async-generator closing helper because Python 3.9 lackscontextlib.aclosing; it can be refactored tocontextlib.aclosingonce 3.9 support is dropped._async.pysources;composition.pyis intentionally async-only and is not picked up.create_service_provider(...)providers, then compose those existing providers withasync with provide_services(...)in listeners/jobs/CLI/guards. Ch.3 will add the Litestar wrapper for that path.Validation
.venv/bin/pytest tests/unit/test_utils/test_dependencies.py tests/unit/test_extensions/test_litestar/test_providers_wire_compat.py tests/unit/test_extensions/test_litestar/test_providers.py tests/unit/test_extensions/test_fastapi/test_providers.py tests/unit/test_service -q.venv/bin/ruff check advanced_alchemy/utils/dependencies.py advanced_alchemy/extensions/litestar/providers.py advanced_alchemy/extensions/fastapi/providers.py advanced_alchemy/service/composition.py advanced_alchemy/service/_typing.py tests/unit/test_utils/test_dependencies.py tests/unit/test_extensions/test_litestar/test_providers_wire_compat.py tests/unit/test_extensions/test_litestar/test_providers.py tests/unit/test_extensions/test_fastapi/test_providers.py tests/unit/test_service/test_composition.py tests/unit/test_service/test_composition_typing.py.venv/bin/mypy advanced_alchemy/utils/dependencies.py advanced_alchemy/extensions/litestar/providers.py advanced_alchemy/extensions/fastapi/providers.py advanced_alchemy/service/composition.py advanced_alchemy/service/_typing.py tests/unit/test_utils/test_dependencies.py tests/unit/test_extensions/test_litestar/test_providers_wire_compat.py tests/unit/test_extensions/test_fastapi/test_providers.py tests/unit/test_service/test_composition.py tests/unit/test_service/test_composition_typing.py.venv/bin/pyright advanced_alchemy/utils/dependencies.py advanced_alchemy/extensions/litestar/providers.py advanced_alchemy/extensions/fastapi/providers.py advanced_alchemy/service/composition.py advanced_alchemy/service/_typing.py tests/unit/test_utils/test_dependencies.py tests/unit/test_extensions/test_litestar/test_providers_wire_compat.py tests/unit/test_extensions/test_fastapi/test_providers.py tests/unit/test_service/test_composition.py tests/unit/test_service/test_composition_typing.py📚 Documentation preview: https://litestar-org.github.io/advanced-alchemy-docs-preview/722