groupon / node-cached

A simple caching library for node.js, inspired by the Play cache API
BSD 3-Clause "New" or "Revised" License
94 stars 15 forks source link

True timeouts for cache calls #22

Closed jkrems closed 8 years ago

jkrems commented 8 years ago

There are a couple of potential improvements that I didn't include in here, such as:

The latter would be a breaking change, so I kept it to the bare minimum.

ageitgey commented 8 years ago

LGTM.

Adding timeout logic like this always makes me nervous that it will work fine in simple test cases but behavior weirdly under high load/concurrency. But I guess the only way to verify that is to test it under high load :)

jkrems commented 8 years ago

Yeah, I have similar concerns. But I think because the actual sockets aren't opened per command but via a central pool, letting them "hang" shouldn't lead to resource exhaustion. Hopefully. ^^