Skip to content

refactor(mpsc): replace the legacy queue backend #209

Description

@tisonkun

Parent: #206

Goal

Reconsider the existing bounded and unbounded MPSC implementation from first principles now that the direct source layout and benchmark baseline are established.

Direction

  • Preserve the current public sender, receiver, and error contracts.
  • Use a single-consumer notification path rather than a competing-consumer wake-all mechanism.
  • Reuse cancellation-safe internal waiting primitives where they fit.
  • Remove the legacy split and unsafe impl Sync if an owned queue core can provide the same API more directly.
  • Keep bounded capacity and unbounded send semantics explicit.
  • Keep MPSC-specific implementation details under asyncband/src/mpsc; move machinery to the private crate-level internal module only when another family actually shares it.

Acceptance criteria

  • Cancellation, disconnection, draining, ordering, and backpressure behavior remain covered at observable boundaries.
  • Benchmarks include at least 1 and 8 producers with one consumer for bounded and unbounded channels.
  • The new implementation has no sustained order-of-magnitude regression against comparable channels and does not materially regress the existing bounded MPSC contention path.
  • Any new unsafe code has a localized invariant and independent justification.
  • The final implementation remains straightforward enough to reason about without relying on an unpublished generic channel framework.

The benchmark baseline in #208 and the source-layout follow-up in #234 are complete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions