Skip to content

refactoring: ♻️ AsyncSemaphore#255

Merged
remimd merged 1 commit intodevfrom
semaphore
Jun 6, 2025
Merged

refactoring: ♻️ AsyncSemaphore#255
remimd merged 1 commit intodevfrom
semaphore

Conversation

@remimd
Copy link
Copy Markdown
Member

@remimd remimd commented Jun 6, 2025

No description provided.

@remimd remimd requested a review from Copilot June 6, 2025 11:04
@remimd remimd self-assigned this Jun 6, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactors semaphore creation into a unified AsyncSemaphore alias, cleans up the FastAPI injection helper, and adjusts the scoped method signature in the module stub.

  • Consolidate semaphore factories into a single AsyncSemaphore alias
  • Rename and re-type FastAPI dependency helper variables
  • Simplify Module.scoped generic parameters in the .pyi stub

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

File Description
injection/ext/fastapi.py Renamed ainstance to lazy_instance and added TypeAlias import
injection/_core/injectables.py Replaced _create_async_semaphore with AsyncSemaphore
injection/_core/common/asynchronous.py Removed standalone factory functions and defined AsyncSemaphore alias
injection/init.pyi Updated scoped signature to drop **P generics
Comments suppressed due to low confidence (1)

injection/init.pyi:152

  • Dropping the **P generic parameters reduces the method’s flexibility for factories that take arguments; consider restoring def scoped[**P, T] to preserve full type inference.
def scoped[T](

Comment thread injection/ext/fastapi.py
Comment thread injection/_core/common/asynchronous.py
@remimd remimd merged commit babfb3d into dev Jun 6, 2025
5 checks passed
@remimd remimd deleted the semaphore branch June 6, 2025 11:08
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

Successfully merging this pull request may close these issues.

2 participants