Skip to content

Document main actor execution in Java hosts - #956

Open
omochi wants to merge 1 commit into
swiftlang:mainfrom
omochi:codex/document-main-executor
Open

omochi wants to merge 1 commit into
swiftlang:mainfrom
omochi:codex/document-main-executor

Conversation

@omochi

@omochi omochi commented Nov 6, 2026

Copy link
Copy Markdown

Background

When using Swift from a Java-hosted process, the host environment may need to integrate Swift's main executor with the platform's event loop or another execution mechanism. Without that integration, asynchronous work that switches to the main actor can stop making progress, whether it is called through a Swift library's public API or used internally.

This change helps swift-java users discover the requirement and consider the appropriate integration for their environment.

Changes

Explain the execution requirements in Java-hosted processes

The jextract documentation explains that Java hosts may need to integrate the main executor. Because the integration depends on the host environment, it links to the Android page for Android-specific details.

Describe integration with the Android UI thread

The Android documentation points to an implementation that runs Swift's main actor on the Android UI thread as one example of integration.

Link to the Android documentation from the README

Android is an important use case for swift-java, and users should be able to find guidance before encountering this issue. The existing README does not enumerate individual limitations, so this change respects that structure and adds only a link to the Android documentation where Android is already mentioned.

Related Links

@omochi
omochi requested a review from ktoso as a code owner November 6, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant