final class RefreshRef[F[_], V] extends AnyRef
- Alphabetic
- By Inheritance
- RefreshRef
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
cancel: F[Boolean]
Cancel polling and remove data from memory
Cancel polling and remove data from memory
- returns
true if there was data and polling, false if it's empty
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get: F[Option[V]]
Simply gets the data from memory
Simply gets the data from memory
- returns
Some(v) if exists, None if not
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getOrFetch(period: FiniteDuration, staleTimeout: FiniteDuration)(fetch: F[V])(errorHandler: PartialFunction[Throwable, F[Unit]]): F[V]
Like
getOrFetch(period: FiniteDuration)(fetch: F[V])
but with added resilency against failures infetch
.Like
getOrFetch(period: FiniteDuration)(fetch: F[V])
but with added resilency against failures infetch
.After
staleTimeout
of continuous polling failures, the polling will stop and data removed. A successfetch
resets the timer.- period
if set to zero will simply return
fetch
- staleTimeout
timeout after the last successful
fetch
-
def
getOrFetch(period: FiniteDuration)(fetch: F[V]): F[V]
Either gets the data from the memory if available, or use the
fetch
to retrieve the data, and setup a polling everyperiod
to update the data in memory usingfetch
.Either gets the data from the memory if available, or use the
fetch
to retrieve the data, and setup a polling everyperiod
to update the data in memory usingfetch
. Hence the first call toref.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 infetch
, whose failure will be surfaced, until it succeeds.- period
if set to zero will simply return
fetch
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()