apple / apple/swift-async-algorithms

Future<T> type

Open
#342 1 comment 5 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
3.7k
Forks
226
Avg merge
10d 3h
Merged PRs (30d)
1

Description

Especially when when writing tests for async code, I often find myself needing a good ol' Future type, with an API equivalent to:

```swift
final class Future: Sendable
func fulfill(_ value: T)
var value: T { get async }
}
```

Instead of copy-pasting it between projects, I'd be happy to contribute a more polished version here. Would you be interested in it?

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests; start with the proposed Future API and review the repository's existing async algorithms and concurrency conventions. Confirm the intended scope with maintainers, then define completion as an agreed, polished Future implementation with appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.