Skip to content
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
@vaultec81

Description

@vaultec81

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High: Likely tackled by core team if no one steps upenv:browserexp/expertHaving worked on the specific codebase is importantpkg:http-clientIssues related only to ipfs-http-clientstatus/deferredConscious decision to pause or backlog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions