Git Product home page Git Product logo

spdy-push's People

Contributors

jonathanong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spdy-push's Issues

API

right now it's push(res, [path], [options], [priority]) which has too much arity. i'm thinking about making it fluent, something like:

spdy(res).push(path)
  .priority(7)
  .send(new Buffer(1024))
  .acknowledge( err => )

an alternative is to be more koa like:

var push = spdy(res).push(path)
push.type = 'json'
push.body = new Buffer(1024)
push.acknowledge( err => )

which of the three approaches do you guys prefer? i think i'm leaning towards the fluent approach.

Use native promises

While any-promise is a nice solution, I think we could simplify maintaining Promises for dependencies further by using native promises. Node has supported Promise since 0.12, and IE is the only modern browser that is missing Promise support(which can be polyfilled with babel-promise or replaced with webpack externals). While this is a little more work for IE support I like that it makes the Promise implementation selection more predictable.

coverage

only at 90%. i got lazy. sorry to ruin the badges guys

is this still maintained?

I am attempting to implement http2/spdy push in an express app. I had it working fine with the .push() method exposed by require('spdy'), however this would break in the case of a user aborting a request. When I saw that this module handled connection closing, I thought it might do the trick.

However, setting it up per the documentation I receive the following error:

/Users/colevarner/fullpower/node/motionxlive/node_modules/spdy/node_modules/spdy-transport/lib/spdy-transport/stream.js:662  
return callback(err, push);
       ^
TypeError: callback is not a function
    at /Users/colevarner/fullpower/node/motionxlive/node_modules/spdy/node_modules/spdy-transport/lib/spdy-transport/stream.js:662:14
    at /Users/colevarner/fullpower/node/motionxlive/node_modules/spdy/node_modules/spdy-transport/lib/spdy-transport/connection.js:833:5
    at Object.callback (/Users/colevarner/fullpower/node/motionxlive/node_modules/spdy/node_modules/spdy-transport/lib/spdy-transport/stream.js:463:5)
    at Framer.tickSync (/Users/colevarner/fullpower/node/motionxlive/node_modules/spdy/node_modules/spdy-transport/lib/spdy-transport/protocol/base/scheduler.js:130:12)
    at Framer.tick (/Users/colevarner/fullpower/node/motionxlive/node_modules/spdy/node_modules/spdy-transport/lib/spdy-transport/protocol/base/scheduler.js:108:13)
    at /Users/colevarner/fullpower/node/motionxlive/node_modules/spdy/node_modules/spdy-transport/lib/spdy-transport/protocol/base/scheduler.js:102:10
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)

This seems like some sort of incompatibility with the spdy module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.