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

Fix server handler Sendability warnings #156

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

czechboy0
Copy link
Contributor

Motivation

Fixes a warning emitted for each operation method in generated server code, which looked like:

Converting non-sendable function value to '@Sendable (APIHandler) -> ((Operations.listPets.Input) async throws -> Operations.listPets.Output)' may introduce data races

Modifications

Instead of passing the function itself, we now invoke it in a closure.

Result

The warning has gone away.

Test Plan

Adapted integration tests.

@czechboy0 czechboy0 requested a review from simonjbeaumont July 31, 2023 12:17
@simonjbeaumont simonjbeaumont added the 🔨 semver/patch No public API change. label Jul 31, 2023
@czechboy0 czechboy0 merged commit 90c249e into apple:main Jul 31, 2023
@czechboy0 czechboy0 deleted the hd-fix-sendability-warnings branch July 31, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants