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

AsyncIterator support? #268

Open
laurisvan opened this issue Mar 19, 2024 · 2 comments
Open

AsyncIterator support? #268

laurisvan opened this issue Mar 19, 2024 · 2 comments

Comments

@laurisvan
Copy link

I am searching for a faster alternative to Node.js EventEmitter. I am using events through its AsyncIterator interface (https://nodejs.org/api/events.html#eventsonemitter-eventname-options).

EventEmitter3 claims compatibility with Node.js EventEmitter, but I did not find mentions on AsyncIterator support. Is such in plans, or should I bake my own solution on top EventEmitter3? If so, I would appreciate any pointers towards a working sample solution.

@lpinca
Copy link
Member

lpinca commented Mar 20, 2024

eventemitter3 is compatible with the EventEmitter class. Everything else is outside the scope of the project.

@laurisvan
Copy link
Author

Roger that. In my reading, hooking EventEmitter3 to events.on(, ), as in https://nodejs.org/api/events.html#eventsonemitter-eventname-options might work if the original EventEmitter API is followed (and if Node.js also uses them and not some internal API, instead).

I'll have a quick try soonish and let you know how it went.

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

2 participants