public abstract class AbstractProducer<T> extends Object implements Producer<T>
Producer implementation that memoizes the result of its compute method.| Constructor and Description |
|---|
AbstractProducer() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract com.google.common.util.concurrent.ListenableFuture<T> |
compute()
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 abstract com.google.common.util.concurrent.ListenableFuture<T> compute()
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 © 2015 Google, Inc.. All Rights Reserved.