Skip to content
Merged
2 changes: 1 addition & 1 deletion cpp/moq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Every generated type lives in `namespace moq`. Objects are `std::shared_ptr`; re

- A fallible call returns `moq::expected<T>`, which is `std::expected` on C++23 and a bundled `tl::expected` below it. The generated sources and every includer must agree on which, so `moq/moq.hpp` references a symbol named for the one it sees and `src/moq.cpp` defines the one it was built with: a mismatch fails to link.
- An async call returns `moq::Future<T>`. Block on it with `get()` or `wait_for()`, attach a continuation with `std::move(future).then(executor, callback)`, which returns a `moq::Continuation`, or `co_await` it on C++20.
- `moq::Error` is a value holding a `std::variant` of its cases, and `to_string()` gives Rust's `Display` message. Nothing throws. A Rust panic inside a call aborts with a message on stderr, and so does reading an invalid future (see [Cancellation](#cancellation)). A panic in a session's background work closes only that session.
- `moq::Error` is a value holding a `std::variant` of its cases, and `to_string()` gives Rust's `Display` message. Nothing throws. A Rust panic inside a call aborts with a message on stderr, and so does reading an invalid future (see [Cancellation](#cancellation)). A panic in owned background work reaches the next call on that object as a task error; other objects keep running.
- Futures are polled on one process-wide executor thread unless the application installs its own with `moq::set_executor` before the first async call. The executor passed to `then()` dispatches only the continuation. `moq::shutdown()` stops the moq-ffi runtime workers (`moq_ffi_shutdown`), then the executor, before unloading the code a continuation could call into.

## C++ standard
Expand Down
2 changes: 1 addition & 1 deletion doc/lib/c/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ here, from media publish and consume to raw pixels and PCM with the codec
inside. The header is the reference: each function carries a doc comment.

- **Handles and callbacks.** Every object is an integer handle, and every async result arrives on a `moq_status_callback` with your `void *user_data`. A status `> 0` is a live result, `0` a clean close, and `< 0` an error. The last two are terminal: moq-c never touches `user_data` again, so free it there. `*_close` and `*_cancel` only request shutdown; the terminal callback still fires.
- **Errors.** Negative return codes are named by `MOQ_ERROR_*`, and `moq_error()` gives the reason on the calling thread. Auth rejections have their own codes so you don't retry them. For the peer's protocol code use `moq_error_protocol()`; do not parse `moq_error()`. A request-cap closure has kind `MOQ_PROTOCOL_KIND_TOO_MANY_REQUESTS`; reduce the workload or adjust the relay's [session limits](/bin/relay/config#session-and-peer) before reconnecting.
- **Errors.** Negative return codes are named by `MOQ_ERROR_*`, and `moq_error()` gives the reason on the calling thread. Auth rejections have their own codes so you don't retry them. For the peer's protocol code use `moq_error_protocol()`; do not parse `moq_error()`. A panic in a binding background task reports `MOQ_ERROR_PANIC` through its terminal callback; unrelated objects keep running. A request-cap closure has kind `MOQ_PROTOCOL_KIND_TOO_MANY_REQUESTS`; reduce the workload or adjust the relay's [session limits](/bin/relay/config#session-and-peer) before reconnecting.
- **Threading.** Call any function from any thread. Raw publish calls block until the codec takes the frame, which paces a publisher.
- **Zeroed config is the default.** A zeroed `moq_client_config` means the default for every field, so new fields don't break callers. A field whose default isn't zero has a `has_*` flag: `backoff_timeout_us = 0` means "retry forever" only with `has_backoff_timeout = true`.
- **Audio needs cuts.** Video groups at its keyframes, but audio forms a group only where you call `moq_publish_media_cut`: after every frame, or at a segment cadence to align with video.
Expand Down
4 changes: 2 additions & 2 deletions doc/lib/cpp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ Error cases carrying a diagnostic expose it as `reason`; protocol failures expos
rejections are their own cases, so you don't retry them. `error.to_string()`
gives the message Rust's `Display` does, for logs; branch on the case, not the
text. A Rust panic inside a call, or a misused future (`get()` twice), aborts
with a message on stderr instead of throwing. A panic in a session's background
work closes only that session.
with a message on stderr instead of throwing. A panic in owned background work reaches the next call on that object as a task error;
other objects keep running.

A session closed for exceeding the relay's request caps reports the protocol
kind `ProtocolKind::kTooManyRequests`. Reduce
Expand Down
2 changes: 2 additions & 0 deletions doc/lib/dart/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Native I/O and background tasks run on a Tokio worker pool. Calls awaited by the
host still poll in place; independent native wake callbacks can run concurrently.
The generated bindings deliver native wakeups to the Dart isolate. Keep UI work
on its owning isolate.
A panic in a native background task reaches the pending and later fallible calls
of every object that depends on it as a task error; other objects keep running.

A session closed for exceeding the relay's request caps reports the protocol
kind `ProtocolKind.tooManyRequests`. Reduce
Expand Down
2 changes: 2 additions & 0 deletions doc/lib/go/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ Native I/O and background tasks run on a Tokio worker pool. Calls awaited by the
host still poll in place; independent native wake callbacks can run concurrently.
The generated bridge synchronizes wakeups before resuming the awaiting goroutine.
Application goroutines remain responsible for serializing their own shared state.
A panic in a native background task reaches the pending and later fallible calls
of every object that depends on it as a task error; other objects keep running.

A session closed for exceeding the relay's request caps reports the protocol
kind `ProtocolKindTooManyRequests`. Reduce
Expand Down
2 changes: 2 additions & 0 deletions doc/lib/kt/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ Native I/O and background tasks run on a Tokio worker pool. Calls awaited by the
host still poll in place; independent native wake callbacks can run concurrently.
The generated bindings resume Kotlin coroutines through their dispatcher. Use
the UI dispatcher when updating UI state.
A panic in a native background task reaches the pending and later fallible calls
of every object that depends on it as a task error; other objects keep running.

A session closed for exceeding the relay's request caps reports the protocol
kind `ProtocolKind.TOO_MANY_REQUESTS`. Reduce
Expand Down
2 changes: 2 additions & 0 deletions doc/lib/py/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ Native I/O and background tasks run on a Tokio worker pool. Calls awaited by the
host still poll in place; independent native wake callbacks can run concurrently.
The generated bindings wake Python futures through the asyncio event loop. The
package exit hook joins native workers before interpreter finalization.
A panic in a native background task reaches the pending and later fallible calls
of every object that depends on it as a task error; other objects keep running.

A session closed for exceeding the relay's request caps reports the protocol
kind `ProtocolKind.TOO_MANY_REQUESTS`. Reduce
Expand Down
2 changes: 2 additions & 0 deletions doc/lib/swift/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ Native I/O and background tasks run on a Tokio worker pool. Calls awaited by the
host still poll in place; independent native wake callbacks can run concurrently.
The generated bindings resume Swift continuations. Use the appropriate actor
when updating UI state.
A panic in a native background task reaches the pending and later fallible calls
of every object that depends on it as a task error; other objects keep running.

A session closed for exceeding the relay's request caps reports the protocol
kind `ProtocolKind.tooManyRequests`. Reduce
Expand Down
7 changes: 7 additions & 0 deletions doc/setup/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ These land with the next breaking release, not the 2026-09-23 train.
- **`cache::Pool::gc` takes a waiter.** In Rust, `gc(now)` is
`gc(now, waiter)`, like `Driver::poll`: call it again when the waiter wakes,
since a parked read can arm an earlier deadline than the one returned.
- **Native background panics.** UniFFI reports `MoqError::Task` with a panic
reason, and C reports `MOQ_ERROR_PANIC`. Other objects keep running. Browser
WebAssembly still aborts on panic with the current toolchain.
- **Accepted sessions return their driver task.** `moq_tokio::server::Request::ok()`
now returns `(session, driver)`. Await the supervised driver before classifying
the session close, so a driver panic reports `moq_tokio::Error::Panic` rather
than the cancellation its teardown leaves on a channel.
- **A QUIC load-balancer nonce needs its server id.** `listen.lb_nonce`,
`--listen-quic-lb-nonce`, and `MOQ_LISTEN_QUIC_LB_NONCE` without `lb_id` stop
startup. Setting `lb_id` (or `lb_nonce`) and `load_balancer` together also
Expand Down
2 changes: 1 addition & 1 deletion go/wrapper/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
ErrTimeOverflow = ffi.ErrMoqErrorTimeOverflow
// ErrLogLevel matches an unparseable log level string passed to LogLevel.
ErrLogLevel = ffi.ErrMoqErrorLogLevel
// ErrTask matches a panic or cancellation in a background native task.
// ErrTask matches a panic in an owned background native task; cancellation is ErrCancelled.
ErrTask = ffi.ErrMoqErrorTask
// ErrJSON matches malformed JSON passed through the FFI API.
ErrJSON = ffi.ErrMoqErrorJson
Expand Down
1 change: 0 additions & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ above them.
- [Live largest location](/quest/m1/largest.md) - `largest()` replaces `latest()` in Rust and JS as a live stream of the track's largest location, known before the first group from the publisher's report
- [Live TS clock validation](/quest/m1/ts-live-clock.md) - resolve the local PCR-rate failure with reproducible timing evidence and CI controls
- [TS export start-up drift](/quest/m1/ts-drift-startup.md) - a TS export never exits on start-up latency from a source within tolerance, while a far-off source still fails within seconds (#5564)
- [Binding panic supervision](/quest/m1/ffi-panic-supervision.md) - a panic in any moq-c or moq-ffi background task reaches the host as a panic, never a lost callback or Cancel
- [Kotlin destroyed arguments](/quest/m1/kt-destroyed-arg.md) - a destroyed object passed to a generated Kotlin call throws instead of aborting the process
- [More tests under load](/quest/m1/test-flakes-2/README.md) - the second round of load-only failures, one quest per flake, fixed at the cause
- [Plan: a public model](/quest/m1/model-public-surface.md) - every crate-private model item is made public or unnecessary, so a custom publisher or subscriber builds from the public model alone
Expand Down
44 changes: 0 additions & 44 deletions quest/m1/ffi-panic-supervision.md

This file was deleted.

4 changes: 0 additions & 4 deletions quest/m2/task-supervision.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,3 @@ relay and the CLI already do.

Public API: `Listener::accept`'s signature in moq-tokio (and
`Server::serve_*`'s result). Wire: none.

## Related

- [Binding panic supervision](/quest/m1/ffi-panic-supervision.md) - the moq-c and moq-ffi tasks, ahead of this
21 changes: 11 additions & 10 deletions rs/moq-c/src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,16 @@ impl Audio {

pub fn consume(
&mut self,
broadcast: &moq_net::broadcast::Consumer,
catalog: &hang::catalog::AudioConfig,
name: &str,
rendition: crate::consume::Rendition<hang::catalog::AudioConfig>,
config: moq_audio::decode::Options,
on_frame: OnStatus,
) -> Result<Id, Error> {
let broadcast = broadcast.clone();
let catalog = catalog.clone();
let name = name.to_string();
let crate::consume::Rendition {
broadcast,
config: catalog,
name,
driver,
} = rendition;

let channel = oneshot::channel();
let entry = AudioTaskEntry {
Expand All @@ -230,10 +231,10 @@ impl Audio {
// `decode::Consumer::new` subscribes (blocking on SUBSCRIBE_OK), so run it
// inside the task to keep this entrypoint non-blocking.
tokio::spawn(async move {
let res = async move {
let res = crate::ffi::run(driver.watch(async move {
let consumer = moq_audio::decode::Consumer::new(&broadcast, &catalog, name, config).await?;
Self::run(on_frame, consumer, channel.1).await
}
}))
.await;

// Deliver one final terminal callback (code <= 0), then drop the entry.
Expand Down Expand Up @@ -520,10 +521,10 @@ pub unsafe extern "C" fn moq_decode_audio(
let on_frame = unsafe { OnStatus::new(user_data, on_frame)? };

let mut state = State::lock();
let (broadcast, audio_cfg, name) = state.consume.audio_rendition(catalog, index as usize)?;
let rendition = state.consume.audio_rendition(catalog, index as usize)?;

let State { audio, .. } = &mut *state;
audio.consume(&broadcast, &audio_cfg, &name, config, on_frame)
audio.consume(rendition, config, on_frame)
})
}

Expand Down
Loading
Loading