@brushy/di-core exposes explicit scope APIs for tests, background jobs, and non-HTTP workflows.
createScope(scopeKey?)
Returns a ScopedContainer bound to a scope object:
scopeKey to share a bucket across callers:
ScopedContainer API
dispose() calls container.clearScopedInstances(scopeKey).
Low-level scope bucket
When to use explicit scopes
Cleanup
Request scope middleware andrunInRequestScope call container.clearRequestScope() on exit unless skipRequestScopeCleanup: true.
For manual scopes, always call scope.dispose() or clearScopedInstances when the unit of work ends.