Skip to content

Make body stream writer sendable #835

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

Merged
merged 4 commits into from
Apr 29, 2025

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Apr 29, 2025

Motivation:

The body stream writer can be sent across isolation domains so should be sendable.

Modifications:

  • Make it explicitly sendable
  • Add appropriate preconcurrency annotations
  • Wrap an iterator from swift-algorithms as it hasn't yet annotated its types with Sendable

Result:

Body stream writer is sendable

Motivation:

The body stream writer can be sent across isolation domains so should be
sendable.

Modifications:

- Make it explicitly sendable
- Add appropriate preconcurrency annotations
- Wrap an iterator from swift-algorithms as it hasn't yet annotated its
  types with Sendable

Result:

Body stream writer is sendable
@glbrntt glbrntt added the 🆕 semver/minor Adds new public API. label Apr 29, 2025
@glbrntt
Copy link
Collaborator Author

glbrntt commented Apr 29, 2025

This is expected:

1 breaking change detected in AsyncHTTPClient:
  💔 API breakage: constructor HTTPClient.Body.StreamWriter.init(closure:) is now with @preconcurrency

@Lukasa Lukasa merged commit a4fcd70 into swift-server:main Apr 29, 2025
22 of 24 checks passed
@glbrntt glbrntt deleted the strict-stream-writer branch April 29, 2025 14:50
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.

2 participants