public interface ImmediateSupplier<T> extends com.google.common.base.Supplier<T>
Supplierthat has an extra method capable of supplying a value immediately or an absent if definitely not available, or throwing an
ImmediateSupplier.ImmediateUnsupportedExceptionif it cannot determine whether a value is immediately available.
|Modifier and Type||Interface and Description|
Indicates that a supplier does not support immediate evaluation, i.e.
Indicates that an attempt was made to forcibly get a requested immediate value where blocking is required.
Maybe.absent()if the value requires blocking, or throws
ImmediateSupplier.ImmediateUnsupportedExceptionif it cannot be determined whether the value requires blocking or not.
Maybe.absent() returned here indicates that a value definitively is pending, just it is not yet available,
and an attempt to
Maybe.get() it should throw an
it can be created with
avoid creating traces (or simply with
This is in contrast with this method throwing a
ImmediateSupplier.ImmediateUnsupportedException which should be done
if the presence of an eventual value cannot even be determined in a non-blocking way.
Implementations of this method should typically catch the former exception if encountered and return a
Maybe.absent() wrapping it, whereas
ImmediateSupplier.ImmediateUnsupportedException instances should be propagated.
ImmediateSupplier.ImmediateUnsupportedException- as above, if cannot be determined whether a value is or might eventually be available