jextract/jni: Propagate CompletableFuture cancellation to Swift tasks
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 54/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- mobile-dev
調査の方向性
Start by tracing the JNI async call and generated thenApply result-conversion stage described in the issue, then review the reference workaround in the linked pull request. Check how cancellation reaches the source future and the Swift task; done means cancelling the returned Java future forwards cancellation to the Swift task so cooperative operations such as Task.sleep can observe it.
索引モデルが issue の本文から書いたものです。
説明
Problem
Cancelling a future returned by a JNI async call currently changes only the Java future's state. The underlying Swift task keeps running. The generated thenApply result-conversion stage also prevents cancellation of the returned future from reaching the source future.
Example
public func waitForWork() async throws -> Int64 {
try await Task.sleep(for: .seconds(60))
return 1
}
A Java caller can cancel the returned future:
var future = MySwiftLibrary.waitForWork();
future.cancel(false);
The Java future is cancelled, but the Swift task continues running. Cancellation of the returned future should also be forwarded to the Swift task, so cancellation-aware operations such as Task.sleep can observe it.
Swift cancellation is cooperative: forwarding cancellation does not interrupt an operating-system thread or wait for the task to finish.
Reference workaround implementation: https://github.com/qoncept/swift-java/pull/10
- 主要言語
- Swift
- スター
- 1.3k
- フォーク
- 127
- 平均マージ
- 2日 14時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
swiftlang/swift-java のほかの issue
-
wrap-java: Optional convenience methods can fail to compile when a parameter shadows the method nameオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
swiftlang/swift-java#945 ·
メンテナーはふだん 1 日以内に返信
-
android
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
swiftlang/swift-java#663 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
swiftlang/swift-java#949 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
swiftlang/swift-java#948 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 53/100
swiftlang/swift-java#946 ·
メンテナーはふだん 1 日以内に返信
swiftlang/swift-java の issue をすべて見る
似ている issue
-
addition
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
jaywcjlove/awesome-mac#4259 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
VictorKildahl/cra#192 ·
メンテナーはふだん 1 日以内に返信
-
area:docs phase:release priority:p0 type:test
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openwallet-foundation/multipaz#2161 ·
メンテナーはふだん 1 日以内に返信
-
[Type] Bug Accessibility Notifications
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wordpress-mobile/WordPress-iOS#26340 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信