-
-
Notifications
You must be signed in to change notification settings - Fork 4
API #1
Comments
What is the spdy(res).push(path, body, {
type: 'json',
priority: 7
}) I'm not familiar enough to know which things are optional and which are not, though. |
haha i'm going to look it up right now. i think it's when the server acknowledges that the push stream is created. |
it's also optional, so we would allow users to not even bother with |
if people don't always need to know if it was ack'd, it seems like it would be an event: var resource = spdy(res).push(path, body, {
type: 'json',
priority: 7
})
resource.on('acknowledge', fn)
resource.on('finish', fn) |
yeah i'm trying to get away from event emitters. hahaha. |
i also want to return a promise so you can just do |
gotcha :) i'm not saying i like ees, but i typically try to stay with the node.js core paradigms |
ya maybe i'll just add it anyways. won't know for sure what people want until i release something. |
Why do you like promises so much? I mean, all use-cases are covered with callbacks and generators. And promises seem to get in the way of chaining api too much. In this case eventemitter+chaining api fits better imho. |
because then i could use generators on them and people who don't use generators can still use them. and they'll be compatible with await/async stuff |
okay i added basic stuff. need to add callback and event support next |
right now it's
push(res, [path], [options], [priority])
which has too much arity. i'm thinking about making it fluent, something like:an alternative is to be more koa like:
which of the three approaches do you guys prefer? i think i'm leaning towards the fluent approach.
The text was updated successfully, but these errors were encountered: