From a0208f5908ab2b9869d5eabb478c34844a17b50c Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 10 Jul 2015 14:50:43 -0700 Subject: [PATCH] add intro and goal --- README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index db71478..bbf1adc 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ abstract-stream-muxer > A test suite and interface you can use to implement a stream muxer. +The primary goal of this module is to enable developers to pick and swap their stream muxing module as they see fit for their application, without having to go through shims or compatibility issues. This module and test suite was heavily inspired by [abstract-blog-store](https://github.com/maxogden/abstract-blob-store). + +Publishing a test suite as a module lets multiple modules all ensure compatibility since they use the same test suite. + +The API is presented with both Node.js and Go primitives, however, there is not actual limitations for it to be extended for any other language, pushing forward the cross compatibility and interop through diferent stacks. + # Modules that implement the interface - @@ -22,10 +28,19 @@ Send a PR to add a new one if you happen to find or write one. A valid (read: that follows this abstraction) stream muxer, must implement the following API. -### `Node.js` muxer.attach(transport, function (err, conn)) || `Go` conn, err := muxer.attach(transport) +### Attach muxer to a transport + +- `Node.js` muxer.attach(transport, function (err, conn)) +- `Go` conn, err := muxer.attach(transport) -### `Node.js` conn.dialStream(function (err, stream)) || `Go` stream, err := conn.dialStream() +### Dial(open/create) a new stream + +- `Node.js` conn.dialStream(function (err, stream)) +- `Go` stream, err := conn.dialStream() -### `Node.js` conn.on('stream', function (stream)) || `Go` stream := conn.listen() +### Listen(wait/receive) a new incoming stream + +- `Node.js` conn.on('stream', function (stream)) +- `Go` stream := conn.listen()