hapijs/catbox — pull request #93 by jardakotesovec (2014-10-01 16:18:10+00:00)
Title: Concurrency

Assuming that `get` method from engine is asynchronous and can take bit more time occasionally, there is window where cache serves accidentally old value.

If `generateFunc` is faster than `staleTimeout` or `generateTimeout ` it will fire old values via `setTimeout` and if there are pending callbacks it will send old value. Its only short window, when there are pending callbacks that can be hit by this setTimeout, its after calling `get` on cache engine.