Stage 4: Document async/await + optional UniTask integration#298
Open
MaxHeimbrock wants to merge 1 commit into
Open
Stage 4: Document async/await + optional UniTask integration#298MaxHeimbrock wants to merge 1 commit into
MaxHeimbrock wants to merge 1 commit into
Conversation
Stage 4 (capstone) of the UniTask migration. Adds a README section covering the three interchangeable async styles the SDK now supports, and states the policy: coroutines remain the default and fully supported; async/await and UniTask are additive opt-ins; the coroutine API is not deprecated. - async/await with no dependency (instructions are awaitable; inspect IsError, await does not throw — parity with yield return). - UniTask opt-in (com.cysharp.unitask + LIVEKIT_UNITASK): AsUniTask with CancellationToken, UniTask.WhenAll composition, and AsAsyncEnumerable for await foreach over incremental streams (throws StreamError on error EoS). Examples use the verified public signatures (Connect(url, token, RoomOptions), PublishTrack(track, options), ReadIncremental().AsAsyncEnumerable()) and point to the Meet sample (UniTask) and Basic sample (coroutines) as references. Docs-only; no code, no deprecation, no version bump. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Capstone of the UniTask migration. Adds a README section, "Asynchronous programming: coroutines, async/await, and UniTask", documenting the three interchangeable async styles the SDK now supports, and states the forward policy.
Policy (decided): keep both, no deprecation. Coroutines (
yield return) remain the default and fully supported; async/await and UniTask are purely additive opt-ins. The coroutine API is not deprecated and no removal is planned — any future change would go through a deprecation cycle.What the new section documents
GetAwaiter); inspectIsErroron the instruction,awaitdoes not throw (parity withyield return); continuations resume on the main thread. Includes theasync voidcaveat for event handlers.com.cysharp.unitask; theLIVEKIT_UNITASKdefine auto-enables theLiveKit.UniTaskassembly. Examples:AsUniTask(cancellationToken)(Stage 2),UniTask.WhenAll(...)parallel publish, andawait foreachoverreader.ReadIncremental().AsAsyncEnumerable(ct)with theStreamErrorthrow-on-error contract (Stage 3). Points to the Meet sample (UniTask) and Basic sample (coroutines).Notes
README.md, +56 lines). No code, no[Obsolete], no sample/scene changes, no version bump (releases use GitHub-generated notes).Connect(url, token, RoomOptions),PublishTrack(track, options),ReadIncremental().AsAsyncEnumerable(). (The README's pre-existing 2-argConnectexample is stale and left untouched as out of scope.)Targeting
Base branch is
max/yield-instruction-async-enumerable(Stage 3, PR #297) so the documented API matches the full shipped surface. Chain: Stage 1 (#289) → Stage 2 (#290) → Stage 3 (#297) → Stage 4 (this).Test plan
Runtime/Scripts/(Connect/PublishTrack overloads,AsUniTask,AsAsyncEnumerable,StreamError).🤖 Generated with Claude Code