grpc / grpc-swift

The Swift language implementation of gRPC.
Apache License 2.0
2.05k stars 420 forks source link

Add support for async await #1205

Closed bordunosp closed 2 years ago

bordunosp commented 3 years ago

are you planning to move to the "async-await" paradigm? mb there is already some branch for tests?

glbrntt commented 3 years ago

Yes, we plan on adopting async await. We don't have anything for users to play around with yet though.

bordunosp commented 3 years ago

swift-nio has already demo sources for support swift 5.5 https://github.com/apple/swift-nio/tree/main/Sources/NIOAsyncAwaitDemo

and around this vapor has branch https://github.com/vapor/vapor/tree/async-await

glbrntt commented 3 years ago

We now have an experimental release with initial support async/await https://github.com/grpc/grpc-swift/releases/tag/1.4.1-async-await.1

Jerry-Carter commented 3 years ago

Thank you for the 1.4.1-async-await branch. Curious what the roadmap is. Specifically, are there plans for a 1.5.0-async-await branch? Do you anticipate this being folded in before 2.0? Thanks.

glbrntt commented 3 years ago

Thank you for the 1.4.1-async-await branch. Curious what the roadmap is. Specifically, are there plans for a 1.5.0-async-await branch?

Yes, we'll try to get that done soon.

Do you anticipate this being folded in before 2.0?

Yes. The rough plan is to expose an async/await API alongside the existing API in a 1.x release so folks can move over to it if/when they choose. The next major version would drop the old API and keep just the async/await API as close as feasibly possible (at least for generated clients and service providers) in order to make migration from 1.x to 2.x less painful.

With that in mind I'd like to leave this a little more time to let the current async/await APIs bake and also to improve test coverage. Feedback on APIs, usability and so on are always helpful so please let us know if you have any thoughts!

glbrntt commented 2 years ago

Support for async await was added in the 1.8.0 release.

cristian064 commented 2 years ago

Support for async await was added in the 1.8.0 release.

Hi do you know where can I find the documentation about how to use async await on GRPC?

glbrntt commented 2 years ago

This is probably the best place to start: https://github.com/grpc/grpc-swift/blob/main/docs/basic-tutorial.md