This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
ipfs.add async Iterable not truly asynchronous. Does not function as intended. #2838
Closed
Description
Hello
I have noticed after doing some experimentation that ipfs-http-client requires the input async iterable to be completed in order for the request to proceed. There is no output until the input async iterable is completed. Meaning the code functions no different then if an array was specified instead.
However, if using js-ipfs in process daemon ipfs.add will function as intended. Returning CIDs through the output async iterable as the input async iterable is processed.
In my use case I am reading the output, and continuing to pass input as it is processed.
Example code
//Source with no definite end.
for await (var out of ipfs.add(source)) {
console.log(out.cid.string);
//Never gets executed
}