mikeal/morestreams — Issue #4: edge case
Author: dominictarr
Created: 2011-11-11 00:23:31+00:00
State: open

what if there is a write to the buffered stream later in the same tick as it has been piped, but before it has emitted it's chunks.
those chunks will be written out of order.

``` js
var b = new (require('morestreams').BufferedStream)()

b.write('1\n')
b.write('2\n')
b.write('3\n')
b.pipe(process.stdout, {end: false})
b.write('4\n')
b.write('5\n')
b.write('6\n')

```

gives output:

```
4
5
6
1
2
3
```

I think that it is correct to emit the chunks in the next tick, but incoming writes should be buffered until the buffered chunks have been emitted.