(From #5)
tilelive modules may load sources once and "cache" them internally. This means that references are being held to sources that may be closed when evicted from the source cache. (This is a more macro version of the case for which I introduced closeDelay, where references are being actively used (for long-running render tasks, e.g.) at the same approximate time that they're evicted.)
2 ideas come to mind to more generally address the issue (and eliminate the closeDelay timeout):
- adopt pool semantics (of unlimited size), where sources are acquired and released. That way we'll know when all references have been accounted for and sources can be closed. This would require changes to the
tilelive API though.
- define a set of "cache lifecycle" events, adopting the
open and close events that are emitted by some tilelive sources. This would require that clients reload sources when they're closed, which would require changes to anything that makes a tilelive.load() call.
(1) feels cleaner, though an approach that minimizes API changes is necessary.
/cc @garnertb
(From #5)
tilelive modules may load sources once and "cache" them internally. This means that references are being held to sources that may be closed when evicted from the source cache. (This is a more macro version of the case for which I introduced
closeDelay, where references are being actively used (for long-running render tasks, e.g.) at the same approximate time that they're evicted.)2 ideas come to mind to more generally address the issue (and eliminate the
closeDelaytimeout):tileliveAPI though.openandcloseevents that are emitted by some tilelive sources. This would require that clients reload sources when they're closed, which would require changes to anything that makes atilelive.load()call.(1) feels cleaner, though an approach that minimizes API changes is necessary.
/cc @garnertb