Skip to content

FileDictをSwift Concurrency対応#260

Closed
mtgto wants to merge 7 commits intomainfrom
filedict-mainactor
Closed

FileDictをSwift Concurrency対応#260
mtgto wants to merge 7 commits intomainfrom
filedict-mainactor

Conversation

@mtgto
Copy link
Copy Markdown
Owner

@mtgto mtgto commented Dec 29, 2024

UserDictやFileDictでSwift Concurrency対応してSwift 6でコンパイルエラーになるという警告が出ないように修正します。

辞書の参照や単語の追加削除は基本的には @MainActor にしていくだけなのですが、読み込みだけは時間がかかるため別スレッドでの実行を可能にする必要があります。
そのためnonisolatedなメソッド FileDict#load を生やし、読み込み処理はそちらにもっていきます。
nonisolatedなメソッド内でメンバ変数dictを設定する必要があり、そのためにasyncメソッドにしています。

@mtgto
Copy link
Copy Markdown
Owner Author

mtgto commented Apr 7, 2026

#452 に続く。このPRはクローズします。

@mtgto mtgto closed this Apr 7, 2026
@mtgto mtgto deleted the filedict-mainactor branch April 7, 2026 13:55
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