{"action":"created","issue":{"url":"https://api.github.com/repos/jshttp/on-finished/issues/21","repository_url":"https://api.github.com/repos/jshttp/on-finished","labels_url":"https://api.github.com/repos/jshttp/on-finished/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/jshttp/on-finished/issues/21/comments","events_url":"https://api.github.com/repos/jshttp/on-finished/issues/21/events","html_url":"https://github.com/jshttp/on-finished/issues/21","id":183449060,"number":21,"title":"write EPIPE","user":{"login":"fundon","id":27926,"avatar_url":"https://avatars.githubusercontent.com/u/27926?v=3","gravatar_id":"","url":"https://api.github.com/users/fundon","html_url":"https://github.com/fundon","followers_url":"https://api.github.com/users/fundon/followers","following_url":"https://api.github.com/users/fundon/following{/other_user}","gists_url":"https://api.github.com/users/fundon/gists{/gist_id}","starred_url":"https://api.github.com/users/fundon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fundon/subscriptions","organizations_url":"https://api.github.com/users/fundon/orgs","repos_url":"https://api.github.com/users/fundon/repos","events_url":"https://api.github.com/users/fundon/events{/privacy}","received_events_url":"https://api.github.com/users/fundon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-17T15:30:24Z","updated_at":"2016-10-17T15:54:39Z","closed_at":"2016-10-17T15:39:46Z","body":"### Koa v2 example\r\n\r\n```js\r\n'use string'\r\n\r\nvar Koa = require('koa')\r\nvar app = new Koa()\r\n\r\napp.use(({ res }) => {\r\n  res.statusCode = 200\r\n  res.end(JSON.stringify({ hello: 'world' }))\r\n})\r\n\r\napp.listen(3000)\r\n```\r\n\r\n```console\r\nautocannon -c 100 -d 5 -p 10 localhost:3000\r\n```\r\n\r\n```\r\n    at listener (node_modules/on-finished/index.js:170:15)\r\n    at onFinish (node_modules/on-finished/index.js:101:5)\r\n    at callback (node_modules/ee-first/index.js:55:10)\r\n    at Socket.onevent (node_modules/ee-first/index.js:93:5)\r\n    at emitOne (events.js:101:20)\r\n    at Socket.emit (events.js:188:7)\r\n    at onwriteError (_stream_writable.js:340:10)\r\n    at onwrite (_stream_writable.js:358:5)\r\n    at WritableState.onwrite (_stream_writable.js:89:5)\r\n```"},"comment":{"url":"https://api.github.com/repos/jshttp/on-finished/issues/comments/254249237","html_url":"https://github.com/jshttp/on-finished/issues/21#issuecomment-254249237","issue_url":"https://api.github.com/repos/jshttp/on-finished/issues/21","id":254249237,"user":{"login":"fundon","id":27926,"avatar_url":"https://avatars.githubusercontent.com/u/27926?v=3","gravatar_id":"","url":"https://api.github.com/users/fundon","html_url":"https://github.com/fundon","followers_url":"https://api.github.com/users/fundon/followers","following_url":"https://api.github.com/users/fundon/following{/other_user}","gists_url":"https://api.github.com/users/fundon/gists{/gist_id}","starred_url":"https://api.github.com/users/fundon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fundon/subscriptions","organizations_url":"https://api.github.com/users/fundon/orgs","repos_url":"https://api.github.com/users/fundon/repos","events_url":"https://api.github.com/users/fundon/events{/privacy}","received_events_url":"https://api.github.com/users/fundon/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T15:54:39Z","updated_at":"2016-10-17T15:54:39Z","body":"@dougwilson Okay, I updated the example.\r\n\r\n```js\r\nvar http = require('http')\r\nvar onFinished = require('on-finished')\r\n\r\nhttp.createServer(function onRequest(req, res) {\r\n  onFinished(res, function (err) {\r\n    if (err) console.error(err)\r\n  })\r\n  res.statusCode = 200\r\n  res.end(JSON.stringify({ hello: 'world' }))\r\n}).listen(3000)\r\n```\r\n\r\n```console\r\nλ ~/D/r/t/server > autocannon -c 100 -d 5 -p 10 localhost:3000\r\nRunning 5s test @ http://localhost:3000\r\n100 connections with 10 pipelining factor\r\n\r\nStat         Avg     Stdev    Max\r\nLatency (ms) 11.04   34.05    303\r\nReq/Sec      8901.21 830.63   9671\r\nBytes/Sec    1.04 MB 94.18 kB 1.18 MB\r\n\r\n45k requests in 5s, 5.21 MB read\r\n```\r\n\r\n```\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n{ Error: write EPIPE\r\n    at exports._errnoException (util.js:1026:11)\r\n    at WriteWrap.afterWrite [as oncomplete] (net.js:802:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }\r\n```"}}
{"actor":{"display_login":"fundon"}}