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

Request async iterator #278

Merged
merged 2 commits into from Aug 14, 2023
Merged

Request async iterator #278

merged 2 commits into from Aug 14, 2023

Conversation

hbgl
Copy link
Contributor

@hbgl hbgl commented Aug 12, 2023

Resolves issue #277

Implement the async iterator protocol for mock request.

The request emits a new custom event 'async_iterator' after a new async iterator is created. Async iterators are generally created lazily on demand. The async iterator will only yield data that is sent after it has been created since the request does not have an internal buffer (unlike stream.Readable). Without the new event it would be hard to know when exactly it is okay send data because you might sent it before the async iterator has been created. Check this test case for how to use the new event.

@eugef
Copy link
Owner

eugef commented Aug 14, 2023

Hi @hbgl thank you for the contribution.
Published in version 1.13.0

@eugef eugef merged commit 9a565e0 into eugef:master Aug 14, 2023
3 checks passed
@s100
Copy link

s100 commented Oct 5, 2023

FYI, this change broke support for Node.js 8, so we're pinning to 1.12.2. Bet you didn't think anyone was still using Node.js 8, huh? 😁 We have some extremely old legacy packages which use Node.js 8, which we still rebuild from time to time. Not a big deal of course! Just thought you might be interested to know.

@eugef
Copy link
Owner

eugef commented Oct 5, 2023

Hi @s100 thanks for reporting the issue, but we do not support Node.js 8 anymore.
All features are only tested for Node.js 14 and above

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

Successfully merging this pull request may close these issues.

None yet

3 participants