Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream spec #4

Open
nichoth opened this issue Sep 17, 2016 · 3 comments
Open

stream spec #4

nichoth opened this issue Sep 17, 2016 · 3 comments

Comments

@nichoth
Copy link

nichoth commented Sep 17, 2016

Thanks everyone for working on pull streams. It's a cool pattern. There are some details to being a proper source or sink, a "contract" that each follows. Is there a re-usable test suite that any source or sink should pass? I might make one. Maybe it is not useful or possible.

@ahdinosaur
Copy link
Member

hey @nichoth, yeah i reckon a re-usable test suite (kinda like abstract-leveldown, abstract-blob-store, interface-pull-blob-store, etc) would be awesome! was actually mentioned in passing a few days ago: pull-stream/pull-file#4 (comment).

@dominictarr
Copy link
Member

@nichoth that would be a very valuable contribution!

I made one of those for classic streams, https://github.com/dominictarr/stream-spec
and it totally helped me understand everything about how they worked.

A reusable test suit might be difficult, since there are so many ways to use pull-streams,
but it might be very useful to have a validator stream, that say, wrapped a stream, and checked thinks like, no calls out of turn, never callback twice, etc. With this approach you still need to write test cases, though, but it would help. Also, you could drop it into production code, when you suspect something isn't working right.

@nichoth
Copy link
Author

nichoth commented Sep 21, 2016

I've started something here. It's pretty new code, just to get started, but everyone feel free to use or patch as you like. https://github.com/nichoth/pull-stream-spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants