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

[Feat][Swift-5.7]: Concurrency in top-level code #54

Open
Blackjacx opened this issue Dec 8, 2022 · 0 comments
Open

[Feat][Swift-5.7]: Concurrency in top-level code #54

Blackjacx opened this issue Dec 8, 2022 · 0 comments
Assignees

Comments

@Blackjacx
Copy link
Owner

Blackjacx commented Dec 8, 2022

What is your wish?

SE-0343 upgrades Swift’s support for top-level code – think main.swift in a macOS Command Line Tool project – so that it supports concurrency out of the box. This is one of those changes that might seem trivial on the surface, but took a lot of work to make happen.

Urgency

Low

Code Example

import Foundation
let url = URL(string: "https://hws.dev/readings.json")!
let (data, _) = try await URLSession.shared.data(from: url)
let readings = try JSONDecoder().decode([Double].self, from: data)
print("Found \(readings.count) temperature readings")
@Blackjacx Blackjacx self-assigned this Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant