public abstract class AbstractProducer<T> extends Object implements Producer<T>
Producer implementation that memoizes the result of its compute method.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractProducer() |
protected |
AbstractProducer(javax.inject.Provider<ProductionComponentMonitor> monitorProvider,
ProducerToken token) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract com.google.common.util.concurrent.ListenableFuture<T> |
compute(ProducerMonitor monitor)
Computes this producer's future, which is then cached in
get(). |
com.google.common.util.concurrent.ListenableFuture<T> |
get()
Returns a future representing a running task that produces a value.
|
protected AbstractProducer()
protected AbstractProducer(javax.inject.Provider<ProductionComponentMonitor> monitorProvider, @Nullable ProducerToken token)
protected abstract com.google.common.util.concurrent.ListenableFuture<T> compute(ProducerMonitor monitor)
get().public final com.google.common.util.concurrent.ListenableFuture<T> get()
ProducerT will be submitted to the executor, as their dependencies become available.
If the key is bound to a Produces method, then calling this method multiple times
will return the same future.
Copyright © 2016 Google, Inc.. All Rights Reserved.