add intro and goal

This commit is contained in:
David Dias 2015-07-10 14:50:43 -07:00
parent 4fd2bf1505
commit a0208f5908

View File

@ -5,6 +5,12 @@ abstract-stream-muxer
> A test suite and interface you can use to implement a 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 # 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. 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()