apple / apple/swift-async-algorithms
Provide an option for chunking based on a signal to include empty chunks
- Dominant language
- Swift
- Stars
- 3.7k
- Forks
- 226
- Avg merge
- 10d 3h
- Merged PRs (30d)
- 1
Description
For sequences that chunk based on a signal, the signal will be effectively ignored if no elements were received since the previous signal. Adding an option to pass an empty chunk on such a signal would be useful, particularly for use cases where you want to detect and report on the absence of something regularly happening.
An alternative approach would be to make this the default behaviour since there are other mechanisms that can be used to compose a sequence that only produces non-empty chunks.
Contributor guide
Research direction
The issue is the entry point; locate the signal-based chunking API and its existing tests. First trace how a signal is handled when no elements arrive, then determine whether an option or default behavior is appropriate and verify empty chunks without changing non-empty cases. Done means coverage for consecutive signals and normal chunking behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100