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 Sendable conformance to core async/await API #1378

Merged
merged 3 commits into from
Apr 1, 2022

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Mar 29, 2022

Motivation:

The core async/await API should have appropriate 'Sendable' conformance
before we publish it to main. This change adds it to the core parts of
the new API.

There are still numerous types which can be made 'Sendable' but are
either less significant (e.g. configuration) or require depdendencies to
adopt 'Sendable' first (and would otherwise require @preconcurrency)

Modifications:

  • Add GRPCSendable to ease adoption
  • Make some plain-old-data types Sendable including GRPCStatus
  • Require Request and Response to be Sendable in the client and
    server async APIs
  • Make the async server context @unchecked Sendable
  • Make the async writer and stream reader Sendable

Result:

Core async API is Sendable.

@glbrntt glbrntt force-pushed the sendable branch 3 times, most recently from 9d68108 to 32e25ce Compare March 30, 2022 07:35
glbrntt added 2 commits March 30, 2022 14:52
Motivation:

The core async/await API should have appropriate 'Sendable' conformance
before we publish it to main. This change adds it to the core parts of
the new API.

There are still numerous types which can be made 'Sendable' but are
either less significant (e.g. configuration) or require depdendencies to
adopt 'Sendable' first (and would otherwise require `@preconcurrency`)

Modifications:

- Require swift-protobuf to be at least 1.19.0 (as 1.19.0 introduced
  `Sendable` to generated messages)
- Regenerate examples etc.
- Add `GRPCSendable` to ease adoption
- Make some plain-old-data types `Sendable` including `GRPCStatus`
- Require `Request` and `Response` to be `Sendable` in the client and
  server async APIs
- Make the async server context `@unchecked Sendable`
- Make the async writer and stream reader `Sendable`

Result:

Core async API is `Sendable`.
@glbrntt glbrntt merged commit b341dbb into grpc:1.7.1-async-await Apr 1, 2022
@glbrntt glbrntt deleted the sendable branch April 1, 2022 08:46
@glbrntt glbrntt added the 🆕 semver/minor Adds new public API. label Jun 13, 2022
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