Open
Description
Hi, let me start from thanking for the awesome project π
Recently I was implementing a custom scope and I noticed a need for explicitly demarking beginning and ending of this scope. Mine was similar to flask_injector
's RequestScope
but could also be used outside web framework context, i.e. in background jobs or CLI commands.
I know injector
is heavily inspired by Guice and I noticed in their documentation that their API supports enter
and exit
methods.
I'd like to start a brainstorming about this concept to either:
- introduce a new API for entering/exiting a scope - similar to
configure
, provide emptyenter
,exit
methods to be overriden, - expand documentation to give others tips to implement such a thing on their own,
- other?
BTW, here's my custom scope implementation: https://github.com/Enforcer/clean-architecture/blob/master/auctioning_platform/main/main/modules.py#L21 Basically, it's a copy-pasted ThreadLocalScope with extras.
Metadata
Metadata
Assignees
Labels
No labels