Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TaskFactory #68

Merged
merged 8 commits into from
Oct 4, 2021
Merged

Add TaskFactory #68

merged 8 commits into from
Oct 4, 2021

Conversation

Siroshun09
Copy link
Member

CompletableFuture.runAsync(Runnable, Executor) を随所で書くのは手間で見辛くもなるので、TaskFactory を API に追加し CompletableFuture を楽に作成できるようにする。

追加

  • TaskFactory - CompletableFuture を作成するインターフェース
    • TaskFactory#run - サーバースレッドで Runnable を実行
    • TaskFactory#supply - サーバースレッドで Supplier を実行
    • TaskFactory#runAsync - Box のスレッドプールで Runnable を実行 (非同期)
    • TaskFactory#supplyAsync - Box のスレッドプールで Supplier を実行 (非同期)
  • BoxAPI#getTaskFactory - TaskFactory のインスタンスを取得

非推奨・削除予定

ExecutorProviderBoxAPI#getExecutorProvider は非推奨とし、4.2.0 で削除する

その他変更

ExecutorProvider の使用箇所を TaskFactory に置き換え

@Siroshun09 Siroshun09 added the enhancement New feature or request label Oct 3, 2021
@Siroshun09 Siroshun09 added this to the 4.1.0 milestone Oct 3, 2021
@Siroshun09 Siroshun09 self-assigned this Oct 3, 2021
Copy link
Member

@LazyGon LazyGon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同期・非同期の書き間違え無し

@Siroshun09 Siroshun09 merged commit f79e50e into v4/develop Oct 4, 2021
@Siroshun09 Siroshun09 deleted the feature/task-factory branch October 4, 2021 00:02
@Siroshun09 Siroshun09 mentioned this pull request Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants