title: How could I handle timeout request in koa?
body: <p>For example:</p>
  
  <pre><code>var app = require('koa')();
  app.use(function *(next) {
      var start = new Date();
      yield next;
  });
  app.use(function *(next) {
      var result = yield loadData();
      this.body = result;
  });
  app.listen(8080);
  </code></pre>
  
  <p>Let's assume that if <code>loadData</code> returns data more than 1 second, then I want <code>this.body = 'there is a timeout'</code>. How could I achieve this? I don't think <code>setTimeout</code> is able to deal with this. And I tried <code>this.response.setTimeout</code> function, but it said that <code>setTimeout</code> is undefined. Thanks for any suggestion</p>