Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 422b2edb22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
MERGE Positive improvement, complexity justified, approach looks right. Rust already ends broadcasts with Concrete strengths:
Not worth a different approach: this is naming + ordering hygiene completing the broadcast-close line. Behavior tweak that ffi This is an automated review, not the maintainer's decision |
…indings # Conflicts: # doc/lib/c/index.md
A concurrent close() returned Ok before the first caller had closed the broadcast. Also end the data-track tests merged from main with moq_publish_close. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Landed. Changes made while merging:
(Written by Claude Opus 5.5) |
Problem
Rust ends a broadcast with
broadcast::Producer::close()(#4047), but every binding still spells itfinish(), a name that implies a clean-versus-aborted distinction the wire cannot carry.Approach
MoqBroadcastProducer::close()closes the broadcast, then finalizes the catalog, so a catalog error cannot stop the broadcast from ending. It holds the state lock throughout, so a concurrent or second call returns only after shutdown and is a no-op.finish()delegates to it and is documented as deprecated. A Rust#[deprecated]is not used because the uniffi scaffolding calls the method and would warn.moq_publish_close.moq_publish_finishis a deprecated alias. OBS and the C tests move toclose.BroadcastProducer.close()(finishemitsDeprecationWarning; its docstring wrongly said it closed the tracks), Swiftclose()(finishis@available(*, deprecated, renamed: "close")), GoClose()(Finishis// Deprecated:). Dart picksclose()up from the generated type.close()would collide with uniffi'sAutoCloseable.close()(twooverride fun close()), sors/moq-ffi/uniffi.tomlexcludes it from Kotlin. Kotlin'sclose()/use {}releases the producer handle, which ends the broadcast like dropping the last Rust producer (unless adynamic()handle is still held). Kotlin keepsfinish()as the forced end for now.close. Fixes the moq-ffiavailable()doc that pointed at a nonexistentbroadcast.closed().bindingsquest and notes the Kotlin gap onremove.md.Impact
MoqBroadcastProducer::close();finish()now also returnsOkon a second call instead ofClosed.moq_publish_close(broadcast);moq_publish_finishdeprecated (doc only, same behavior). A second close fails like any released handle, matchingmoq_origin_closeand friends.close()/Close();finish/Finishdeprecated.closeexcluded from bindgen).Alternatives
closeBroadcast()) via[bindings.kotlin.rename]. That keeps a forced end on Kotlin afterfinishis removed but breaks the "one name everywhere" goal. Or make the ffi object close the broadcast on drop, soAutoCloseable.close()always forces the end; rejected because a GC finalizer (Go, Python) would then end a broadcast still served through a helddynamic().moq_publish_closereturn 0. Rejected: libmoq handles are freed on close, and every othermoq_*_closeerrors on an unknown id.#[deprecated]attribute plus cbindgen deprecation macros for C. Skipped as extra machinery for an alias removed ondev.Follow-ups
finishgoes; decide there whether it needs one.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code