Skip to content

moq-lite: port Origin API renames from #1358#1380

Merged
kixelated merged 1 commit intotighten-moq-lite-apifrom
port-origin-api-renames
May 5, 2026
Merged

moq-lite: port Origin API renames from #1358#1380
kixelated merged 1 commit intotighten-moq-lite-apifrom
port-origin-api-renames

Conversation

@kixelated
Copy link
Copy Markdown
Collaborator

Stacked on #1378.

Ports the public-API renames from #1358 without the new state model. The existing OriginNode tree, web_async::spawn cleanup, and tokio mpsc fan-out stay untouched.

Renames

  • OriginProducer::publish_only -> scope
  • OriginConsumer::consume_only -> scope
  • OriginConsumer::try_consume_broadcast -> get_broadcast
  • OriginProducer::consume_only and try_consume_broadcast: dropped (write producer.consume().scope(p) / .get_broadcast(p) instead)

Rationale: every consume_xxx on OriginProducer was a one-liner shortcut for producer.consume().xxx(). Dropping them keeps the producer surface focused on publishing. The try_ and consume_ prefixes were redundant on OriginConsumer.

New BroadcastConsumer primitives

  • is_closed() and poll_closed(waiter) — thin wrappers over conducer::Consumer. Lets callers compose close-detection without spawning a task per broadcast.

NOT in this PR

  • The new HashMap+Mutex state model.
  • OriginProducer clone-as-refcount + Drop-closes-on-last (behavior change tied to the new model).
  • OriginConsumer::is_closed / poll_next (channel close signal — net-new, not a rename).
  • OriginUpdate enum — keeping the existing OriginAnnounce tuple.
  • Suffix churn (publish_broadcast -> publish, etc.) — separate crate-wide question, deferred.

Test plan

  • cargo check --workspace
  • cargo test -p moq-lite --lib model::origin (41/41 origin tests pass)
  • cargo test --workspace --lib
  • just check
  • Spot-check relay + clock end-to-end

🤖 Generated with Claude Code

…odel)

- Rename OriginProducer::publish_only / OriginConsumer::consume_only → scope.
- Drop OriginProducer::consume_only and OriginProducer::try_consume_broadcast;
  callers go through producer.consume().scope(..) / .get_broadcast(..) so
  the producer surface is publish-only.
- Rename OriginConsumer::try_consume_broadcast → get_broadcast (the consumer
  receiver and try_ prefix were both redundant).
- Add BroadcastConsumer::is_closed and poll_closed (thin wrappers over
  conducer::Consumer) so callers can compose close-detection without
  spawning a task per broadcast.
- Migrate every workspace caller (lite/ietf publishers, libmoq, moq-clock,
  moq-relay).

Keeps the existing OriginNode / mpsc / web_async::spawn implementation,
the OriginAnnounce tuple, and the announced/try_announced/announced_broadcast
naming. Suffix churn (publish_broadcast → publish, etc.) is intentionally
out of scope here — it should be a separate crate-wide pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kixelated kixelated merged commit e99d0f3 into tighten-moq-lite-api May 5, 2026
1 check passed
@kixelated kixelated deleted the port-origin-api-renames branch May 5, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant