-
Notifications
You must be signed in to change notification settings - Fork 8
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
Proposal: change binding #26
Comments
In JS, |
Needs an end callback somewhere (or, I guess, it could be a thenable)... I am not really sure what kind of options you would want to specify at this level... most should be specified when the components are instantiated, imo. Maybe encoding? I mean, do people actually need to change string encoding mid stream? Does that need to be at this level though? |
Thinking about it further, you're right, |
One big question I ran into yesterday while prototyping is where to put the "final bind callback" that the sink would normally have.
Like... I'm not sure this should return a true Promise but maybe it should be thenable? Is that too ludicrous an idea? |
For the JavaScript side, I think returning a thenable is completely reasonable. For the equivalent C++ API, passing in a callbacck function works just fine. |
Well, this turned out good I think: #31 |
Introduces `Stream()`, a much more user friendly way of composing streaming operations out of bob components. `Stream()`s also act as a bare passthrough to their subcomponents and can be use as a component when composing higher-order `Stream()`s. Relys on the newly added `start(exitCb)` to keep things nice. Refs: #26 PR-URL: #31
Done in 5a460b4 although we may still want to get rid of bind altogether. (Or possibly make it so that |
Actually, going to keep this open. Is class-based If not... this is possible now that the exit callback is done via function bob_bind(source, sink) {
source.sink = sink
sink.source = source
} Edit: oh, right. That still makes implementing |
Binding is ugly and I bet it is the least comprehensible part right now.
Ideally I guess it would look something like
Stream(source, transform, sink)
.The text was updated successfully, but these errors were encountered: