From e6ec8c39cc4df4453345aaa7da214550ba02a567 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 10 Oct 2026 13:57:03 -0700 Subject: [PATCH 1/4] chore(quest): claim track request demand Co-Authored-By: GPT-6 From 02ffffe9dbe4a8aa4db8970d25bca7ced73be6d0 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 10 Oct 2026 14:24:28 -0700 Subject: [PATCH 2/4] feat(ffi): expose demand before accepting a track Co-Authored-By: GPT-6 --- doc/lib/cpp/index.md | 5 +++ doc/lib/dart/index.md | 5 +++ doc/lib/go/index.md | 5 +++ doc/lib/kt/index.md | 5 +++ doc/lib/py/index.md | 5 +++ doc/lib/swift/index.md | 5 +++ go/wrapper/publish.go | 9 +++++ py/moq-rs/moq/publish.py | 4 +++ py/moq-rs/tests/test_local.py | 8 +++++ quest/m1/ffi-shape/README.md | 1 - quest/m1/ffi-shape/track-request-demand.md | 34 ------------------- quest/m1/group-demand-accept.md | 3 -- rs/moq-ffi/src/producer.rs | 6 ++++ rs/moq-ffi/src/test.rs | 39 ++++++++++++++++++++++ swift/Sources/Moq/Dynamic.swift | 5 +++ 15 files changed, 101 insertions(+), 38 deletions(-) delete mode 100644 quest/m1/ffi-shape/track-request-demand.md diff --git a/doc/lib/cpp/index.md b/doc/lib/cpp/index.md index dca6016ac7e..4b4bd21b250 100644 --- a/doc/lib/cpp/index.md +++ b/doc/lib/cpp/index.md @@ -192,3 +192,8 @@ Everything else maps one to one onto the header is the reference; every method carries its doc comment. - Source: [`cpp/moq`](https://github.com/moq-dev/moq/tree/main/cpp/moq); `just cpp check` builds, installs, and tests it locally + +A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before +accepting the request to watch subscribers through the handoff to its producer; +wait for it to become unused before stopping expensive production. The watch is +weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/dart/index.md b/doc/lib/dart/index.md index 6cc48d322c5..e325bb407b9 100644 --- a/doc/lib/dart/index.md +++ b/doc/lib/dart/index.md @@ -78,3 +78,8 @@ one to one; the API reference has the names. - API reference: [pub.dev/documentation/moq](https://pub.dev/documentation/moq/latest/) - Source: [`dart/`](https://github.com/moq-dev/moq/tree/main/dart) - Packages: [moq](https://pub.dev/packages/moq), [moq\_ffi](https://pub.dev/packages/moq_ffi) + +A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before +accepting the request to watch subscribers through the handoff to its producer; +wait for it to become unused before stopping expensive production. The watch is +weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/go/index.md b/doc/lib/go/index.md index 4426728b382..0c4656c8ee0 100644 --- a/doc/lib/go/index.md +++ b/doc/lib/go/index.md @@ -105,3 +105,8 @@ one to one; the API reference has the names. - API reference: [pkg.go.dev/moq.dev/moq](https://pkg.go.dev/moq.dev/moq) - Source: [`go/`](https://github.com/moq-dev/moq/tree/main/go); `just go check` builds and tests locally - Mirrors the vanity path resolves to: [moq-dev/moq-go](https://github.com/moq-dev/moq-go) (wrapper), [moq-dev/moq-go-ffi](https://github.com/moq-dev/moq-go-ffi) (raw bindings and static libraries) + +A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before +accepting the request to watch subscribers through the handoff to its producer; +wait for it to become unused before stopping expensive production. The watch is +weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/kt/index.md b/doc/lib/kt/index.md index 76ff144d80f..f20cdb6c51c 100644 --- a/doc/lib/kt/index.md +++ b/doc/lib/kt/index.md @@ -81,3 +81,8 @@ one to one; the API reference has the names. - API reference: [javadoc.io/doc/dev.moq/moq](https://javadoc.io/doc/dev.moq/moq) - Source: [`kt/`](https://github.com/moq-dev/moq/tree/main/kt); `just kt check` builds and tests locally - Artifacts: [dev.moq:moq](https://central.sonatype.com/artifact/dev.moq/moq), [dev.moq:moq-ffi](https://central.sonatype.com/artifact/dev.moq/moq-ffi) + +A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before +accepting the request to watch subscribers through the handoff to its producer; +wait for it to become unused before stopping expensive production. The watch is +weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/py/index.md b/doc/lib/py/index.md index 402ffc3ed01..d9fd3d92803 100644 --- a/doc/lib/py/index.md +++ b/doc/lib/py/index.md @@ -100,3 +100,8 @@ one to one; the API reference has the names. - API reference: [moq-rs.readthedocs.io](https://moq-rs.readthedocs.io) - Source and examples: [`py/moq-rs`](https://github.com/moq-dev/moq/tree/main/py/moq-rs) - Raw bindings: [`moq-ffi`](https://pypi.org/project/moq-ffi/) on PyPI, for the unwrapped API + +A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before +accepting the request to watch subscribers through the handoff to its producer; +wait for it to become unused before stopping expensive production. The watch is +weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/swift/index.md b/doc/lib/swift/index.md index d8c52caf79f..33657ebf4e0 100644 --- a/doc/lib/swift/index.md +++ b/doc/lib/swift/index.md @@ -82,3 +82,8 @@ one to one; the API reference has the names. - API reference: [Swift Package Index (DocC)](https://swiftpackageindex.com/moq-dev/moq-swift/documentation/moq) - Source: [`swift/`](https://github.com/moq-dev/moq/tree/main/swift); `just swift check` builds and tests on a Mac - Packages SPM resolves: [moq-dev/moq-swift](https://github.com/moq-dev/moq-swift), [moq-dev/moq-swift-ffi](https://github.com/moq-dev/moq-swift-ffi) + +A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before +accepting the request to watch subscribers through the handoff to its producer; +wait for it to become unused before stopping expensive production. The watch is +weak and ends when the track closes or the request is rejected. diff --git a/go/wrapper/publish.go b/go/wrapper/publish.go index e7e043a3fa0..ec2a165c628 100644 --- a/go/wrapper/publish.go +++ b/go/wrapper/publish.go @@ -150,6 +150,15 @@ func (r *TrackRequest) Name() (string, error) { return r.inner.Name() } +// Demand watches this track's subscribers, including after accepting it. +func (r *TrackRequest) Demand() (*TrackDemand, error) { + inner, err := r.inner.Demand() + if err != nil { + return nil, err + } + return &TrackDemand{inner: inner}, nil +} + // Dynamic creates a fetch handler before accepting this requested track. func (r *TrackRequest) Dynamic() (*TrackDynamic, error) { inner, err := r.inner.Dynamic() diff --git a/py/moq-rs/moq/publish.py b/py/moq-rs/moq/publish.py index 84606b1071b..dac6dd7b8c1 100644 --- a/py/moq-rs/moq/publish.py +++ b/py/moq-rs/moq/publish.py @@ -186,6 +186,10 @@ def accept(self, info: TrackInfo | None = None) -> TrackProducer: """ return TrackProducer(self._inner.accept(_track_info(info))) + def demand(self) -> TrackDemand: + """Watch this track's subscribers, including after accepting it.""" + return TrackDemand(self._inner.demand()) + def dynamic(self) -> TrackDynamic: """Create a fetch handler before accepting this requested track.""" return TrackDynamic(self._inner.dynamic()) diff --git a/py/moq-rs/tests/test_local.py b/py/moq-rs/tests/test_local.py index 4d040281bbc..25ed2047908 100644 --- a/py/moq-rs/tests/test_local.py +++ b/py/moq-rs/tests/test_local.py @@ -506,6 +506,8 @@ async def test_dynamic_track_request(): request = await asyncio.wait_for(dynamic.requested_track(), timeout=5.0) assert request.name == "events" + demand = request.demand() + assert demand.is_used() # Accept the request as a raw track (which unblocks the subscribe), then write. track = request.accept() @@ -517,7 +519,13 @@ async def test_dynamic_track_request(): assert frame is not None assert frame.payload == payload + track_consumer.cancel() + await asyncio.wait_for(demand.unused(), timeout=5.0) track.finish() + broadcast.close() + del track + with pytest.raises(moq.Error.Closed): # type: ignore[attr-defined] + await asyncio.wait_for(demand.used(), timeout=5.0) async def test_dynamic_track_request_can_publish_media(): diff --git a/quest/m1/ffi-shape/README.md b/quest/m1/ffi-shape/README.md index e47d299c229..781f0bc3b79 100644 --- a/quest/m1/ffi-shape/README.md +++ b/quest/m1/ffi-shape/README.md @@ -75,5 +75,4 @@ runs `just test interop --all`. - [Codecs](/quest/m1/ffi-shape/codec.md) - audio and video producers, codec-only encoders, and decoders move under their own namespaces, named as in Rust; binding releases wait for it - [Named error fields](/quest/m1/ffi-shape/error-fields.md) - `MoqError` variants name their fields, so no binding exposes a positional `v1` - [Bindings](/quest/m0/broadcast-epoch/bindings.md) - the wrappers expose epochs and rename `session.epoch()`, on the reshaped wrappers -- [Track request demand](/quest/m1/ffi-shape/track-request-demand.md) - `MoqTrackRequest::demand()` in moq-ffi and every wrapper, built on group request demand and coordinated with Bindings - [Layers guide](/quest/m1/ffi-shape/layers-guide.md) - a `doc/lib` page maps each Rust layer to every binding's module, once Codecs adds `audio` and `video` diff --git a/quest/m1/ffi-shape/track-request-demand.md b/quest/m1/ffi-shape/track-request-demand.md deleted file mode 100644 index bfac9267e9a..00000000000 --- a/quest/m1/ffi-shape/track-request-demand.md +++ /dev/null @@ -1,34 +0,0 @@ -# [S] A track request reports its demand - -## Goal - -`MoqTrackRequest` gains `demand()` in moq-ffi and every wrapper (Python, Go, -Swift, Kotlin, Dart, C++), returning a `MoqTrackDemand` like -`MoqTrackProducer.demand()`, so a dynamic track server can see when nobody -still wants the track and stop producing it. Mirrors Rust's -`track::Request::demand`. - -## Plan - -Found in #5139 (group request demand), decided 2026-10-09: that quest -assumed `MoqTrackRequest.demand()` already existed, but moq-ffi only has -`demand()` on `MoqTrackProducer` and the media and JSON producers. Start -after #5139 lands, and follow its `MoqGroupRequest.demand()` binding shape, -but keep Rust's lifetime: `accept` hands the same track state to the -producer, so the handle keeps watching it and returns `Closed` only once the -request is rejected or the track closes. A dynamic server can then stop -producing when the last subscriber leaves. - -Decided in the 2026-10-10 audit: preserve the -[hand-written C freeze](/quest/m1/c/README.md). Add the feature to moq-ffi -and its wrappers; generated C inherits it when that package lands. Do not -extend `rs/moq-c`'s hand-written ABI. Update the applicable `doc/lib` pages. - -Additive in every binding. It edits the same wrappers as -[Bindings](/quest/m0/broadcast-epoch/bindings.md) (#5146), so land it after -that PR to avoid conflicts, without blocking on it. Run -`just test interop --all`. Wire: none. - -## Related - -- [Bindings](/quest/m0/broadcast-epoch/bindings.md) - edits the same wrappers; land after it diff --git a/quest/m1/group-demand-accept.md b/quest/m1/group-demand-accept.md index 8109a4d75fc..ed7decd7930 100644 --- a/quest/m1/group-demand-accept.md +++ b/quest/m1/group-demand-accept.md @@ -25,6 +25,3 @@ no change. Public API: behavior only (the error a demand wait returns). Wire: none. -## Related - -- [Track request demand](/quest/m1/ffi-shape/track-request-demand.md) - its demand should end the same way diff --git a/rs/moq-ffi/src/producer.rs b/rs/moq-ffi/src/producer.rs index 8cd0d7c76fb..df85db120ba 100644 --- a/rs/moq-ffi/src/producer.rs +++ b/rs/moq-ffi/src/producer.rs @@ -400,6 +400,12 @@ impl MoqTrackRequest { Ok(request.name().to_string()) } + /// Watch this track's subscribers, including after the request is accepted. + pub fn demand(&self) -> Result, MoqError> { + let guard = self.inner.lock().unwrap(); + Ok(MoqTrackDemand::new(guard.as_ref().ok_or(MoqError::Closed)?.demand())) + } + /// Create a handler for uncached group fetches before accepting this track. /// /// Obtain and retain this handle before `accept()` when the track itself was diff --git a/rs/moq-ffi/src/test.rs b/rs/moq-ffi/src/test.rs index 84b10be010d..a1f2cb099c1 100644 --- a/rs/moq-ffi/src/test.rs +++ b/rs/moq-ffi/src/test.rs @@ -936,6 +936,45 @@ async fn json_consumer_takes_an_unread_track() { )); } +#[tokio::test] +async fn track_request_demand_survives_accept() { + let broadcast = MoqBroadcastProducer::new().unwrap(); + let dynamic = broadcast.dynamic().unwrap(); + let consumer = broadcast.consume().unwrap(); + let subscribe = tokio::spawn(async move { consumer.subscribe_track("events".into(), None).await }); + let request = dynamic.requested_track().await.unwrap(); + let demand = request.demand().unwrap(); + assert_eq!(demand.name(), "events"); + assert!(demand.is_used()); + let track = request.accept(None).unwrap(); + assert!(matches!(request.demand(), Err(MoqError::Closed))); + let consumer = subscribe.await.unwrap().unwrap(); + demand.used().await.unwrap(); + consumer.cancel(); + demand.unused().await.unwrap(); + let consumer = track.consume(None).unwrap(); + demand.used().await.unwrap(); + consumer.cancel(); + demand.unused().await.unwrap(); + drop(track); + broadcast.close().unwrap(); + assert!(matches!(demand.used().await, Err(MoqError::Closed))); +} + +#[tokio::test] +async fn track_request_demand_ends_on_rejection() { + let broadcast = MoqBroadcastProducer::new().unwrap(); + let dynamic = broadcast.dynamic().unwrap(); + let consumer = broadcast.consume().unwrap(); + let subscribe = tokio::spawn(async move { consumer.subscribe_track("events".into(), None).await }); + let request = dynamic.requested_track().await.unwrap(); + let demand = request.demand().unwrap(); + request.abort(404).unwrap(); + assert!(subscribe.await.unwrap().is_err()); + assert!(demand.used().await.is_err()); + assert!(matches!(request.demand(), Err(MoqError::Closed))); +} + #[tokio::test] async fn dynamic_track_request() { let broadcast = MoqBroadcastProducer::new().unwrap(); diff --git a/swift/Sources/Moq/Dynamic.swift b/swift/Sources/Moq/Dynamic.swift index 9ab9445c60f..3dc7e49ff29 100644 --- a/swift/Sources/Moq/Dynamic.swift +++ b/swift/Sources/Moq/Dynamic.swift @@ -21,6 +21,11 @@ public final class TrackRequest: Sendable { TrackProducer(try ffi.accept(info: info)) } + /// Watch this track's subscribers, including after accepting it. + public func demand() throws -> TrackDemand { + TrackDemand(try ffi.demand()) + } + /// Create a fetch handler before accepting this requested track. public func dynamic() throws -> TrackDynamic { TrackDynamic(try ffi.dynamic()) From 595dd3a24e6c81cbc340a34f219d0529900704dd Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 10 Oct 2026 14:24:59 -0700 Subject: [PATCH 3/4] docs(quest): trim completed demand reference Co-Authored-By: GPT-6 --- quest/m1/group-demand-accept.md | 1 - 1 file changed, 1 deletion(-) diff --git a/quest/m1/group-demand-accept.md b/quest/m1/group-demand-accept.md index ed7decd7930..599f53a7ea5 100644 --- a/quest/m1/group-demand-accept.md +++ b/quest/m1/group-demand-accept.md @@ -24,4 +24,3 @@ docs in Rust, Go, Python, and Swift. Hand-written moq-c is frozen, so it gets no change. Public API: behavior only (the error a demand wait returns). Wire: none. - From 40e1ba6ae78bc30dd75dc1b8762f310efc7d95ec Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 10 Oct 2026 17:52:19 -0700 Subject: [PATCH 4/4] fix(ffi): synchronize track request demand bindings Co-Authored-By: GPT-6 Astra --- dart/moq_ffi/lib/src/moq.dart | 26 ++++++++++++++++++++++++++ doc/lib/cpp/index.md | 9 ++++----- doc/lib/dart/index.md | 6 +----- doc/lib/go/index.md | 6 +----- doc/lib/kt/index.md | 6 +----- doc/lib/py/index.md | 6 +----- doc/lib/swift/index.md | 6 +----- 7 files changed, 35 insertions(+), 30 deletions(-) diff --git a/dart/moq_ffi/lib/src/moq.dart b/dart/moq_ffi/lib/src/moq.dart index dd89cb80cb3..e22784b3dbf 100644 --- a/dart/moq_ffi/lib/src/moq.dart +++ b/dart/moq_ffi/lib/src/moq.dart @@ -8382,6 +8382,7 @@ class FfiConverterMoqTrackProducer { abstract class MoqTrackRequestInterface { void abort({required int errorCode}); MoqTrackProducer accept({required MoqTrackInfo? info}); + MoqTrackDemand demand(); MoqTrackDynamic dynamic_(); String name(); } @@ -8431,6 +8432,17 @@ class MoqTrackRequest implements MoqTrackRequestInterface { ); } + MoqTrackDemand demand() { + return rustCallWithLifter( + (status) => uniffi_moq_ffi_fn_method_moqtrackrequest_demand( + uniffiClonePointer(), + status, + ), + FfiConverterMoqTrackDemand.lift, + moqExceptionErrorHandler, + ); + } + MoqTrackDynamic dynamic_() { return rustCallWithLifter( (status) => uniffi_moq_ffi_fn_method_moqtrackrequest_dynamic( @@ -11969,6 +11981,14 @@ external Pointer uniffi_moq_ffi_fn_method_moqtrackrequest_accept( Pointer uniffiStatus, ); +@Native Function(Pointer, Pointer)>( + assetId: _uniffiAssetId, +) +external Pointer uniffi_moq_ffi_fn_method_moqtrackrequest_demand( + Pointer ptr, + Pointer uniffiStatus, +); + @Native Function(Pointer, Pointer)>( assetId: _uniffiAssetId, ) @@ -12923,6 +12943,9 @@ external int uniffi_moq_ffi_checksum_method_moqtrackrequest_abort(); @Native(assetId: _uniffiAssetId) external int uniffi_moq_ffi_checksum_method_moqtrackrequest_accept(); +@Native(assetId: _uniffiAssetId) +external int uniffi_moq_ffi_checksum_method_moqtrackrequest_demand(); + @Native(assetId: _uniffiAssetId) external int uniffi_moq_ffi_checksum_method_moqtrackrequest_dynamic(); @@ -13448,6 +13471,9 @@ void _checkApiChecksums() { if (uniffi_moq_ffi_checksum_method_moqtrackrequest_accept() != 31841) { throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); } + if (uniffi_moq_ffi_checksum_method_moqtrackrequest_demand() != 3618) { + throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); + } if (uniffi_moq_ffi_checksum_method_moqtrackrequest_dynamic() != 24801) { throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); } diff --git a/doc/lib/cpp/index.md b/doc/lib/cpp/index.md index 4b4bd21b250..c788c469f5a 100644 --- a/doc/lib/cpp/index.md +++ b/doc/lib/cpp/index.md @@ -164,6 +164,10 @@ Never block the executor. A continuation or resumed coroutine that calls which deadlocks. `moq::inline_executor` runs a continuation right where the future completed, which is the executor thread. +## Track demand + +Obtain a dynamic track request’s `demand()` before accepting it to watch subscribers through the handoff to its producer. The watch does not keep the track alive and ends when the track closes or the request is rejected. + ## Shutdown `moq::shutdown()` stops the `moq-ffi` runtime thread, then the executor. @@ -192,8 +196,3 @@ Everything else maps one to one onto the header is the reference; every method carries its doc comment. - Source: [`cpp/moq`](https://github.com/moq-dev/moq/tree/main/cpp/moq); `just cpp check` builds, installs, and tests it locally - -A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before -accepting the request to watch subscribers through the handoff to its producer; -wait for it to become unused before stopping expensive production. The watch is -weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/dart/index.md b/doc/lib/dart/index.md index e325bb407b9..071fe3ed17f 100644 --- a/doc/lib/dart/index.md +++ b/doc/lib/dart/index.md @@ -72,14 +72,10 @@ one to one; the API reference has the names. - **Live encoder timing.** After writing a frame you encoded yourself, call `flush(timestampUs: ...)` with the same timestamp so the catalog advertises your jitter. Skip it for file and network imports. On a seek or pause, call `discontinuity()`, then keep timestamps moving forward and resume video on a keyframe. - **Closing.** `await moq.close()` or `session.shutdown()` gives finished tracks up to one second to deliver and fails if they did not. `session.cancel(code: 0)` closes at once. Finish or abort live tracks first. Cancelling a stream subscription releases its native cursor. - **Stats.** `session.stats()` reports `rttUs`, `estimatedSendRateBps`, `estimatedRecvRateBps`, and the byte and packet counters (`bytesSent`, `bytesReceived`, `bytesLost`, `packetsSent`, `packetsReceived`, `packetsLost`). A field is `null` when the transport does not report it, which is not the same as zero. +- **Track demand.** Obtain a dynamic track request’s `demand()` before accepting it to watch subscribers through the handoff to its producer. The watch does not keep the track alive and ends when the track closes or the request is rejected. ## Reference - API reference: [pub.dev/documentation/moq](https://pub.dev/documentation/moq/latest/) - Source: [`dart/`](https://github.com/moq-dev/moq/tree/main/dart) - Packages: [moq](https://pub.dev/packages/moq), [moq\_ffi](https://pub.dev/packages/moq_ffi) - -A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before -accepting the request to watch subscribers through the handoff to its producer; -wait for it to become unused before stopping expensive production. The watch is -weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/go/index.md b/doc/lib/go/index.md index 0c4656c8ee0..52ad269e699 100644 --- a/doc/lib/go/index.md +++ b/doc/lib/go/index.md @@ -99,14 +99,10 @@ one to one; the API reference has the names. - **Decoded frames hold decoder buffers.** `Close` each `VideoDecodedFrame` promptly, or the decoder stalls. `Resize` is best effort, so read each frame's `Width()` and `Height()`. - **Closing.** `client.Close()` gives finished tracks up to one second to deliver and returns an error if they did not. `session.Shutdown(ctx)` does the same, and `session.Cancel(code)` closes at once. Finish or abort live tracks first. - **Stats.** `Session().Stats()` reports `RTT`, `EstimatedSendRateBps`, `EstimatedRecvRateBps`, and the byte and packet counters (`BytesSent`, `BytesReceived`, `BytesLost`, `PacketsSent`, `PacketsReceived`, `PacketsLost`). A field is nil when the transport does not report it, which is not the same as zero. +- **Track demand.** Obtain a dynamic track request’s `Demand()` before accepting it to watch subscribers through the handoff to its producer. The watch does not keep the track alive and ends when the track closes or the request is rejected. ## Reference - API reference: [pkg.go.dev/moq.dev/moq](https://pkg.go.dev/moq.dev/moq) - Source: [`go/`](https://github.com/moq-dev/moq/tree/main/go); `just go check` builds and tests locally - Mirrors the vanity path resolves to: [moq-dev/moq-go](https://github.com/moq-dev/moq-go) (wrapper), [moq-dev/moq-go-ffi](https://github.com/moq-dev/moq-go-ffi) (raw bindings and static libraries) - -A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before -accepting the request to watch subscribers through the handoff to its producer; -wait for it to become unused before stopping expensive production. The watch is -weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/kt/index.md b/doc/lib/kt/index.md index f20cdb6c51c..c3e897bbeba 100644 --- a/doc/lib/kt/index.md +++ b/doc/lib/kt/index.md @@ -75,14 +75,10 @@ one to one; the API reference has the names. - **Decoded frames hold decoder buffers.** `close()` each frame from `decodeVideo` promptly (or `use { }` it), or the decoder stalls. `resize` is best effort, so read each frame's `width()` and `height()`. - **Closing.** Suspending `moq.shutdown()` gives finished tracks up to one second to deliver and throws if they did not. `Moq.close()`, and so `use { }`, cancels at once. Finish or abort live tracks first. - **Stats.** `session.stats()` reports `rttUs`, `estimatedSendRateBps`, `estimatedRecvRateBps`, and the byte and packet counters (`bytesSent`, `bytesReceived`, `bytesLost`, `packetsSent`, `packetsReceived`, `packetsLost`). A field is `null` when the transport does not report it, which is not the same as zero. +- **Track demand.** Obtain a dynamic track request’s `demand()` before accepting it to watch subscribers through the handoff to its producer. The watch does not keep the track alive and ends when the track closes or the request is rejected. ## Reference - API reference: [javadoc.io/doc/dev.moq/moq](https://javadoc.io/doc/dev.moq/moq) - Source: [`kt/`](https://github.com/moq-dev/moq/tree/main/kt); `just kt check` builds and tests locally - Artifacts: [dev.moq:moq](https://central.sonatype.com/artifact/dev.moq/moq), [dev.moq:moq-ffi](https://central.sonatype.com/artifact/dev.moq/moq-ffi) - -A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before -accepting the request to watch subscribers through the handoff to its producer; -wait for it to become unused before stopping expensive production. The watch is -weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/py/index.md b/doc/lib/py/index.md index d9fd3d92803..45e3e2641a7 100644 --- a/doc/lib/py/index.md +++ b/doc/lib/py/index.md @@ -94,14 +94,10 @@ one to one; the API reference has the names. - **Decoded frames hold decoder buffers.** Drop each frame from `decode_video` promptly, or the decoder stalls. `resize` is best effort, so read each frame's `width()` and `height()`. - **Closing.** `await session.shutdown()` gives finished tracks up to one second to deliver and raises if they did not. `cancel(code)` closes at once. Finish or abort live tracks first. - **Stats.** `session.stats()` reports `rtt`, `estimated_send_rate_bps`, `estimated_recv_rate_bps`, and the byte and packet counters (`bytes_sent`, `bytes_received`, `bytes_lost`, `packets_sent`, `packets_received`, `packets_lost`). A field is `None` when the transport does not report it, which is not the same as zero. +- **Track demand.** Obtain a dynamic track request’s `demand()` before accepting it to watch subscribers through the handoff to its producer. The watch does not keep the track alive and ends when the track closes or the request is rejected. ## Reference - API reference: [moq-rs.readthedocs.io](https://moq-rs.readthedocs.io) - Source and examples: [`py/moq-rs`](https://github.com/moq-dev/moq/tree/main/py/moq-rs) - Raw bindings: [`moq-ffi`](https://pypi.org/project/moq-ffi/) on PyPI, for the unwrapped API - -A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before -accepting the request to watch subscribers through the handoff to its producer; -wait for it to become unused before stopping expensive production. The watch is -weak and ends when the track closes or the request is rejected. diff --git a/doc/lib/swift/index.md b/doc/lib/swift/index.md index 33657ebf4e0..5a2b0031b8f 100644 --- a/doc/lib/swift/index.md +++ b/doc/lib/swift/index.md @@ -76,14 +76,10 @@ one to one; the API reference has the names. - **Decoded frames hold decoder buffers.** Release each frame from `decodeVideo` promptly, or the decoder stalls. `resize` is best effort, so read each frame's `width()` and `height()`. - **Closing.** `try await session.shutdown()` gives finished tracks up to one second to deliver and throws if they did not. `session.cancel(code:)` closes at once. Finish or abort live tracks first. - **Stats.** `session.stats()` reports `rttUs`, `estimatedSendRateBps`, `estimatedRecvRateBps`, and the byte and packet counters (`bytesSent`, `bytesReceived`, `bytesLost`, `packetsSent`, `packetsReceived`, `packetsLost`). A field is `nil` when the transport does not report it, which is not the same as zero. +- **Track demand.** Obtain a dynamic track request’s `demand()` before accepting it to watch subscribers through the handoff to its producer. The watch does not keep the track alive and ends when the track closes or the request is rejected. ## Reference - API reference: [Swift Package Index (DocC)](https://swiftpackageindex.com/moq-dev/moq-swift/documentation/moq) - Source: [`swift/`](https://github.com/moq-dev/moq/tree/main/swift); `just swift check` builds and tests on a Mac - Packages SPM resolves: [moq-dev/moq-swift](https://github.com/moq-dev/moq-swift), [moq-dev/moq-swift-ffi](https://github.com/moq-dev/moq-swift-ffi) - -A dynamic track request exposes `demand()` (`Demand()` in Go). Obtain it before -accepting the request to watch subscribers through the handoff to its producer; -wait for it to become unused before stopping expensive production. The watch is -weak and ends when the track closes or the request is rejected.