Cancel polling and remove data from memory
Cancel polling and remove data from memory
true if there was data and polling, false if it's empty
Simply gets the data from memory
Simply gets the data from memory
Some(v) if exists, None if not
Like getOrFetch(period: FiniteDuration)(fetch: F[V])
but with added resilency against failures in fetch
.
Like getOrFetch(period: FiniteDuration)(fetch: F[V])
but with added resilency against failures in fetch
.
After staleTimeout
of continuous polling failures, the polling will stop and data removed.
A success fetch
resets the timer.
if set to zero will simply return fetch
timeout after the last successful fetch
Either gets the data from the memory if available, or use the fetch
to retrieve the data, and setup
a polling every period
to update the data in memory using fetch
.
Either gets the data from the memory if available, or use the fetch
to retrieve the data, and setup
a polling every period
to update the data in memory using fetch
. Hence the first call to ref.getOrFetch
will take longer
to actually load the data from upstream to memory. Subsequent call will always return the data from memory.
When any exception occurs during getDataFromUpstream
, the refresh stops, and the data is removed from the memory.
All subsequent requests will incure effect in fetch
, whose failure will be surfaced, until
it succeeds.
if set to zero will simply return fetch