I have a simple swift script that I wrote and created a docker image containing this script. The script makes a network call using URLSession and operates on the data to determine success/failure of the script. I wanted to try out migrating this to using async/await, so I changed the base image of my dockerfile to swiftlang/swift:nightly-5.5-bionic, however when running my swiftc command as part of the docker build, I am getting the output below:
#8 1.211 main.swift:43:32: error: type of expression is ambiguous without more context
#8 1.211 let (data, response) = try await URLSession.shared.data(with: request)
#8 1.211 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am not sure what I am doing wrong, but maybe there are more steps to enable concurrency features. Any help would be really appreciated.
There isn't much I can say at this specific time, other than that we definitely know the desire is there from the community for these API to be available.
Thanks @millenomi. I think if the desire is to have Swift be a serious contender on non-Apple platforms, async/await APIs are critical across the board.
Hey @millenomi just wondering if there were any updates. I have been paying attention to the PR, but other than occasional test requests, there's not much activity.
This doesn't have the same semantics as Darwin, because Darwin ensures task cancellation trickles down into canceling the connection, which isn't occurring here.