Iterate over acknowledgements as they arrive
Open
Nobody has claimed this yet.
enhancement
package:socket.io
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
Is your feature request related to a problem? Please describe.
When emitting with multiple acknowledgements, one has to wait for all responses (or the timeout).
const responses = await io.timeout(1000).emitWithAck("hello");
// then process all responses
Describe the solution you'd like
Iterate over the responses as they arrive, something like:
try {
for await (const ack of io.timeout(1000).emitWithAckIterator("hello")) {
// process one single response
}
} catch (e) {
// handle timeout
}
Describe alternatives you've considered
N/A
Additional context
Related: https://github.com/socketio/socket.io/discussions/5062
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the existing emitWithAck API and the related discussion linked in the issue first. Done means providing an async-iterator form that yields acknowledgements as they arrive and handles the timeout behavior shown in the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- api, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100