Skip to content

Remove @Sendable and @escaping restrictions from condition(:_), timeout(for:body:) and withCancellationShield(_:)#148

Open
bauer-andreas wants to merge 3 commits into
mainfrom
andreas-bauer/loosen-timeout-restrictions
Open

Remove @Sendable and @escaping restrictions from condition(:_), timeout(for:body:) and withCancellationShield(_:)#148
bauer-andreas wants to merge 3 commits into
mainfrom
andreas-bauer/loosen-timeout-restrictions

Conversation

@bauer-andreas

Copy link
Copy Markdown
Contributor

Motivation

Currently, the methods condition(:_), timeout(for:body:) and withCancellationShield(_:) require the closure they accept to be @escaping or @Sendable/sending. None of these requirements are actually true.
The closure getting passed to these methods never actually escape the call context. Secondly, because we know everything is executed on the Workflow serial executor, we can also remove the @Sendable and sending requirements as (each of these closures are nonisolated(nonsending) by default now).

Modifications

  • Removed @Sendable @escaping requirement from the timeout closure.
  • Dropped the @escaping requirement for the workflow condition closure.
  • Drop the sending @escaping requirement from the cancellation shield.

Test Plan

N/A

@bauer-andreas bauer-andreas requested a review from FranzBusch June 12, 2026 07:24
@bauer-andreas bauer-andreas added the 🆕 semver/minor Adds new public API. label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant