Skip to content

feat(broadcast): add a bounded lossless MPMC channel #213

Description

@tisonkun

Parent: #206

Status

The unbounded half of the original issue is complete. PR #117 implemented asyncband::broadcast::mpmc::unbounded, and #234 finalized its source layout and public inspection terminology. This issue now tracks only the bounded MPMC broadcast variant.

Goal

Add a bounded MPMC broadcast channel in which every active subscription observes every accepted publication in one committed order and the slowest active subscription applies backpressure.

Contracts

  • bounded(capacity) enforces the requested logical capacity and panics if capacity is zero.
  • An asynchronous send waits when the slowest active subscription prevents reclamation; try_send reports Full without accepting the value.
  • Every accepted publication remains available to every subscription that was active when it was accepted.
  • New subscriptions start at the committed tail.
  • Multiple producers expose one contiguous committed publication order; later claims cannot become visible before earlier claims.
  • Sliding, drop-oldest, overwrite, and lag semantics remain out of scope.

Acceptance criteria

  • Cover fanout, concurrent producers, strict capacity, slow-subscription backpressure, reclamation, sender cancellation, receiver cancellation, disconnection, and panic-safe payload cloning.
  • Benchmark 1 and 8 producers across representative fanout counts against semantically comparable lossless bounded broadcast channels.
  • Compare shared paths with the existing unbounded implementation without forcing both retention policies through an abstraction that obscures either contract.
  • Keep ring, cursor, retention, and sequencing types private; put cross-family machinery under crate::internal only when another implementation actually shares it.

The benchmark baseline in #208 is complete. Prior work and discussion: #117, #146, and #167.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions