Kactoos

kactoos-jvm / nnl.rocks.kactoos.scalar / StickyScalar

StickyScalar

class StickyScalar<T : Any> : Scalar<T>

Cached version of a KScalar.

This KScalar decorator technically is an in-memory cache.

Pay attention that this class is not thread-safe. It is highly recommended to always decorate it with SyncScalar.

There is no thread-safety guarantee.

Parameters

T - Type of result

func - Cached func

See Also

StickyFunc

Since 0.3

Constructors

Name Summary
<init> StickyScalar(scalar: KScalar<T>)

Functions

Name Summary
invoke fun invoke(): T
Get value of this Scalar