From c1da30bc743b04bc6d98213c85ec94b9453ac4d2 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Mon, 30 Sep 2019 18:20:25 +0200 Subject: [PATCH] Add streaming iterables guide (#459) * docs: add streaming iterables guide placeholder * chore: move peer discovery readme to doc fold:wqer * docs: add link to async refactor issue --- README.md | 2 +- PEER_DISCOVERY.md => doc/PEER_DISCOVERY.md | 0 doc/STREAMING_ITERABLES.md | 32 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) rename PEER_DISCOVERY.md => doc/PEER_DISCOVERY.md (100%) create mode 100644 doc/STREAMING_ITERABLES.md diff --git a/README.md b/README.md index 8ad40ebd..bcd8f540 100644 --- a/README.md +++ b/README.md @@ -336,7 +336,7 @@ Required keys in the `options` object: > Peer has been discovered. If `autoDial` is `true`, applications should **not** attempt to connect to the peer -unless they are performing a specific action. See [peer discovery and auto dial](./PEER_DISCOVERY.md) for more information. +unless they are performing a specific action. See [peer discovery and auto dial](./doc/PEER_DISCOVERY.md) for more information. - `peer`: instance of [PeerInfo][] diff --git a/PEER_DISCOVERY.md b/doc/PEER_DISCOVERY.md similarity index 100% rename from PEER_DISCOVERY.md rename to doc/PEER_DISCOVERY.md diff --git a/doc/STREAMING_ITERABLES.md b/doc/STREAMING_ITERABLES.md new file mode 100644 index 00000000..a58727be --- /dev/null +++ b/doc/STREAMING_ITERABLES.md @@ -0,0 +1,32 @@ +# Iterable Streams + +> This document is a guide on how to use Iterable Streams in Libp2p. As a part of the [refactor away from callbacks](https://github.com/ipfs/js-ipfs/issues/1670), we have also moved to using Iterable Streams instead of [pull-streams](https://pull-stream.github.io/). If there are missing usage guides you feel should be added, please submit a PR! + +## Table of Contents + +- [Iterable Streams](#iterable-streams) + - [Table of Contents](#table-of-contents) + - [Usage Guide](#usage-guide) + - [Iterable Modules](#iterable-modules) + +## Usage Guide + +**Coming Soon!** + +## Iterable Modules + +- [it-handshake][it-handshake] Handshakes for binary protocols with iterable streams. +- [it-length-prefixed][it-length-prefixed] Streaming length prefixed buffers with async iterables. +- [it-pair][it-pair] Paired streams that are internally connected. +- [it-pipe][it-pipe] Create a pipeline of iterables. Works with duplex streams. +- [it-pushable][it-pushable] An iterable that you can push values into. +- [it-reader][it-reader] Read an exact number of bytes from a binary, async iterable. +- [streaming-iterables][streaming-iterables] A Swiss army knife for async iterables. + +[it-handshake]: https://github.com/jacobheun/it-handshake +[it-length-prefixed]: https://github.com/alanshaw/it-length-prefixed +[it-pair]: https://github.com/alanshaw/it-pair +[it-pipe]: https://github.com/alanshaw/it-pipe +[it-pushable]: https://github.com/alanshaw/it-pushable +[it-reader]: https://github.com/alanshaw/it-reader +[streaming-iterables]: https://github.com/bustle/streaming-iterables