docs: Clarify actor execution order guarantees in Store#10
Merged
takeshishimada merged 2 commits intomainfrom Oct 30, 2025
Merged
docs: Clarify actor execution order guarantees in Store#10takeshishimada merged 2 commits intomainfrom
takeshishimada merged 2 commits intomainfrom
Conversation
Fix misleading documentation that claimed actions are processed "sequentially". Per SE-0306, Swift actors (including MainActor) do NOT guarantee FIFO ordering - the runtime uses priority-based scheduling. Changes: - Replace "Sequential Processing" section with accurate description - Add explicit reference to SE-0306 with direct quote - Add Warning about non-guaranteed execution order - Provide correct usage examples for guaranteed sequential execution - Add implementation comments explaining task ordering behavior - Update processAction() documentation for clarity The Store now correctly documents that multiple fire-and-forget send() calls may execute in any order, and users must explicitly await for guaranteed sequential execution. Reference: https://github.com/apple/swift-evolution/blob/main/proposals/0306-actors.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <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
Fix misleading documentation that claimed actions are processed "sequentially" in Store. Per SE-0306, Swift actors (including MainActor) do NOT guarantee FIFO ordering - the runtime uses priority-based scheduling.
Problem
The current documentation states:
This is misleading. While actions execute on MainActor (ensuring thread-safety), multiple
send()calls withoutawaitmay execute in any order due to Swift's priority-based task scheduling.Changes
Warningabout non-guaranteed execution orderawaitprocessAction()documentation for clarityTechnical Details
SE-0306 Quote:
Before:
After (Correct Documentation):
Impact
Test Plan
🤖 Generated with Claude Code