RubenVerborgh/AsyncIterator

Do cloned iterators share properties with the iterator they cloned?

Closed this issue · 3 comments

e.g. in this situation:

itA = itB.clone()
itB.getProperty('foo', callback)
itA.setProperty('foo', 123)

Should I expect the callback for getProperty on itB to fire with the value I set on itA?

Yes, that is the expectation. Does that work for you?

I checked and yes, it does work. Just trying to get my head around this library; it would be nice to have more information about properties in the documentation.

Great! Feel free to get in touch if you want to know more about how and why.

We mainly use it for our query engine implementations (https://github.com/LinkedDataFragments/Client.js/, https://github.com/comunica/comunica/). In general, it is the fastest solution to stream objects around in Node.js (compared to streams and async generators).