Skip to content

Feature request: Share an in-flight operation between callers #10

Description

@dombrovsky

Feature request

Allow concurrent callers requesting equivalent work to await one shared in-flight operation and result.

Rationale

FIFO serialization can prevent concurrent execution, but every caller still occupies a queue turn. Consumers commonly need true single-flight behavior to avoid duplicate remote calls, cache stampedes, and repeated initialization.

Use case

Several requests discover that cached data is stale at the same time. The first request starts a refresh, and the remaining requests should await that refresh instead of scheduling equivalent work.

Desired behavior

  • At most one equivalent operation executes at a time.
  • Concurrent callers receive the same successful result or failure.
  • Canceling one caller's wait does not disrupt other callers relying on the shared work.
  • Disposing the owning TaskFlow cancels the shared operation and completes all waiters consistently.
  • A completed operation does not cause later requests to receive stale shared state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions