Swift Driver - async/await adoption

Hiya,

I was just wandering what the plans are for implementing async/await into the Swift driver? Is it being worked on now so that it could be ready when Swift 5.5 is released to the public in and around September?

It feels that async/await is going to be an absolute game changer for Server Side Swift and it would be amazing to be able to use the native Swift driver with it.

Thanks

2 Likes

Hey @Piers_Ebdon ! Thank you for reaching out. I’m very excited about structured concurrency in Swift as well and agree it’s a big step for the server side ecosystem.

To that end, we will definitely be adding async/await APIs to the Swift driver. This will entail adding async versions of each API method that returns an EventLoopFuture, as well as making our sequence-like types conform to the AsyncSequence protocol.

I have already been testing out what this will look like and working on figuring out design questions. We should be starting on implementation very soon so we can release as close to the Swift 5.5 release as possible.

2 Likes

Awesome!!! Exciting times.

Thanks @kmahar

1 Like

@kmahar Any update on the async/await progress? Looks like the GitHub branch hasn’t been committed to in a while: https://github.com/mongodb/mongo-swift-driver/tree/async-await-apis

2 Likes

@kmahar any movement on async/await apis i.e release of v1.3.0?

Hey @Piers_83756, we’ve been doing a series of pre-releases to allow people time to try out the APIs and give us feedback / report any bugs they find etc, most recently 1.3.0-beta.1.

Have you had a chance to try that out / have you run into any issues?

I expect we’ll do the GA release of 1.3 within the next month or so.