Package space.maxus.flare.react
Class MemoizedReactiveComputable<I,O>
java.lang.Object
space.maxus.flare.react.MemoizedReactiveComputable<I,O>
- Type Parameters:
I- The reactive state type.O- The computed result type.
- All Implemented Interfaces:
org.apache.commons.lang3.concurrent.Computable<I,,O> ReactiveSubscriber<I>
public class MemoizedReactiveComputable<I,O>
extends Object
implements org.apache.commons.lang3.concurrent.Computable<I,O>, ReactiveSubscriber<I>
A `Computable`, that uses a `Memoizer` to cache its results based on reactive state.
-
Constructor Summary
ConstructorsConstructorDescriptionMemoizedReactiveComputable(org.apache.commons.lang3.concurrent.Memoizer<I, O> delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidonStateChange(I state) Called whenever value inside a reactive state changes
-
Constructor Details
-
MemoizedReactiveComputable
-
-
Method Details
-
compute
- Specified by:
computein interfaceorg.apache.commons.lang3.concurrent.Computable<I,O> - Throws:
InterruptedException
-
onStateChange
Description copied from interface:ReactiveSubscriberCalled whenever value inside a reactive state changes- Specified by:
onStateChangein interfaceReactiveSubscriber<I>- Parameters:
state- The new state value.- Throws:
ReactiveException- If an error occurs while handling the state change.
-
getCurrentValue
-