Skip to content

Commit 6a90c93

Browse files
kevinburkedougwilson
authored andcommitted
docs: add note about cleaning up processing on timeout
closes #18
1 parent 300ea5d commit 6a90c93

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ $ npm install connect-timeout
2121
middleware processing. See [as top-level middleware](#as-top-level-middleware)
2222
for how to use as a top-level middleware.
2323

24+
While the library will emit a 'timeout' event when requests exceed the given
25+
timeout, node will continue processing the slow request until it terminates.
26+
Slow requests will continue to use CPU and memory, even if you are returning
27+
a HTTP response in the timeout callback. For better control over CPU/memory,
28+
you may need to find the events that are taking a long time (3rd party HTTP
29+
requests, disk I/O, database calls) and find a way to cancel them, and/or
30+
close the attached sockets.
31+
2432
### timeout(time, [options])
2533

2634
Returns middleware that times out in `time` milliseconds. `time` can also

0 commit comments

Comments
 (0)