Skip to content

Request-scoped lifecycle and context propagation #362

Closed

Description

@techmahedy

Area: Application, DI\Container, HTTP, console

Problem

Doppar already drops resolved request-scoped services, but the lifecycle is not exposed as a first-class context that can carry request, job, CLI, and tenant metadata. This makes cleanup and correlation inconsistent across entry points.

Proposal

Introduce an immutable ExecutionContext and explicit lifecycle hooks for request, console, and future worker executions. Bindings may declare a scope (singleton, execution, or transient) and the active context is available through the container and a small facade.

Acceptance criteria

  • Context creation, nesting, and teardown are covered by unit tests.
  • Execution-scoped services cannot leak between two sequential requests.
  • Context metadata is available to the logger without global mutable state.
  • Existing singleton behavior remains backward compatible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfeatnew feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions