| 14 | Handler = (function() { |
| 15 | __extends(Handler, events.EventEmitter); |
| 16 | function Handler(options) { |
| 17 | this.pullSocket = zeromq.createSocket('pull'); |
| 18 | this.pullSocket.connect(options.recv_spec); |
| 19 | this.pullSocket.on('message', __bind(function(message) { |
| 20 | return this.emit('request', new MongrelRequest(message)); |
| 21 | }, this)); |
| 22 | this.pubSocket = zeromq.createSocket('pub'); |
| 23 | this.pubSocket.connect(options.send_spec); |
| 24 | } |
| 25 | Handler.prototype.sendResponse = function(request, response) { |
| 26 | var header, outBuffer; |
| 27 | header = [request.uuid, ' ', request.connectionId.length, ':', request.connectionId, ', '].join(''); |