koajs / koa

Expressive middleware for node.js using ES2017 async functions
https://koajs.com
MIT License
35.07k stars 3.22k forks source link

Client disconnect #1821

Open siakc opened 2 months ago

siakc commented 2 months ago

Suppose a route takes 60 seconds to respond. Client disconnects for some reason at second 25. Will Koa continue running middles or it will terminate context? I ask this to know how to handle some slow routes.

TommyDew42 commented 1 month ago

I guess koa will continue the request and stop when it responds and hits the writable check: in respond and then reach response.writable.