push.js 502 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Module dependencies.
  3. */
  4. var roundrobin = require('../plugins/round-robin');
  5. var queue = require('../plugins/queue');
  6. var Socket = require('./sock');
  7. /**
  8. * Expose `PushSocket`.
  9. */
  10. module.exports = PushSocket;
  11. /**
  12. * Initialize a new `PushSocket`.
  13. *
  14. * @api private
  15. */
  16. function PushSocket() {
  17. Socket.call(this);
  18. this.use(queue());
  19. this.use(roundrobin({ fallback: this.enqueue }));
  20. }
  21. /**
  22. * Inherits from `Socket.prototype`.
  23. */
  24. PushSocket.prototype.__proto__ = Socket.prototype;