Workflow SDK、実行中のキャンセル機能をサポートへ
本文の状態
日本語全文を表示中
詳細モードで約1分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Vercel Blog
Vercel が公開した Workflow SDK のベータ版が、標準的な AbortController と AbortSignal API をワークフローおよびステップの境界全体で利用可能にし、実行中の操作を柔軟にキャンセルできるようになった。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Workflow SDK 5 ベータ版では、ワークフローおよびステップの境界を跨いで標準的な AbortController および AbortSignal API がサポートされるようになりました。
ワークフロー内でコントローラーを作成し、そのシグナルを 1 つ以上のステップに渡すことで、既存の fetch API が使用するのと同じインターフェースを使用して進行中の操作をキャンセルできます。
このシグナルは、一時停止や決定論的な再実行の間も永続的に維持されます。ステップが実行されている場合、それが別の関数呼び出し内にある場合でも、そのキャンセルを検知します。キャンセルは協調的であり、ステップ側でシグナルを確認するか、AbortSignal をサポートする API に渡す必要があります。
耐久性のあるタイムアウトが競合に勝った際に遅いステップを停止したり、最初の成功レスポンス後に残りのリクエストをキャンセルしたり、マルチステップパイプラインを通じて 1 つのシグナルをスレッド処理したり、外部条件の変化に応じて並列作業をキャンセルしたりするために使用できます。
workflow@beta で試して、キャンセルに関するドキュメントを読んでさらに詳しく学んでください。
原文を表示
The Workflow SDK 5 beta now supports the standard AbortController and AbortSignal APIs across workflow and step boundaries.
Create a controller inside a workflow, pass its signal into one or more steps, and cancel in-flight operations using the same API fetch already uses.
That signal stays durable across suspensions and deterministic replay. When a step is running, it sees the cancellation, even when it's in a separate function invocation. Cancellation is also cooperative; steps have to inspect the signal or pass it to an API that supports AbortSignal.
Use it to stop a slow step when a durable timeout wins a race, cancel the remaining requests after the first successful response, thread one signal through a multi-step pipeline, or cancel parallel work when an external condition changes.
Try it with workflow@beta and read the cancellation documentation to learn more.
Read more
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み