Skip to content

dominictarr/pull-sync-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pull-sync-buffer

a stream that synchronously buffers as much as it can before allowing read.

for example, consider the following stream.

var SyncBuffer = require('pull-sync-buffer')

pull(
  pull.values([1,2,3]),
  pull.through(function (e) { console.log('A:', e) }),
  //SyncBuffer(),
  pull.through(function (e) { console.log('B:', e) }),
  pull.drain()
)

the output we'd expect from a pull-stream would be

A: 1
B: 1
A: 2
B: 2
A: 3
B: 3

but if we uncomment //SyncBuffer(), the output will look like

A: 1
A: 2
A: 3
B: 1
B: 2
B: 3

Motivation

you generally don't want a pull-stream which behaves like this, but muxrpc does (until I fix it) so I needed this to test ssb-ebt until then.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published