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.
Node.js Streams vs pull-streams vs ReactiveJS #362
Closed
Description
Reasons for consideration
In the recent months of developing js-ipfs we had some issues with various parts of the different versions of node-streams. Some of the major ones were
- Hard to control
error
handling, especially as wepipe
and wrap streams many times from module to module - Issues with flushing data, write streams don't give guarantees about when data has been written to the underlying data source, for example disk. This resulted in some very problematic race conditions (ref Error: ENOENT: no such file or directory #351)
- Behaviour different depending on the module. Given the complicated history it is not always clear when combining streams from core and multiple modules in which mode they are currently and why they are not behaving as expected.
In light of these issues we are exploring different alternatives to replace the stream based code inside js-ipfs
Currently I have identified two possible alternatives
1. Pull Streams
Example code
Resources
2. RxJS
Example code
- https://github.com/libp2p/js-libp2p-tcp/tree/rxjs
- https://github.com/ipfs/js-ipfs-repo/tree/rxjs
- https://github.com/dignifiedquire/rxjs.node