Returns the first succedding future that matches the predicate.
Returns the first succedding future that matches the predicate.
a collection of futures.
the predicate that has to be matched from the result of the futures.
a future of an optional T that is the result of the first succeding future that also matches the predicate or None otherwise.
Returns the first succeeded future from the given collection discarding the others.
Returns the first succeeded future from the given collection discarding the others.
a collection of futures housing a result of type T
a future holding an optional T that is the first succeded future from the passed iterable or None if no future completed succesfully.
Sugar for getting hold of a ListenableFuture backing a lifted execution against an implicit executor.
Sugar for getting hold of a ListenableFuture backing a lifted execution against an implicit executor. Example:
implicit val executor = Executors.newCachedThreadPool()
val future: ListenableFuture[Int] = future { Thread.sleep(5000); 5 }
11/24/12 7:20 PM
Rich wrapper providing a monadic interface to Guava ListenableFuture.
Checked future is slightly harder but may be possible; we can try to add that at some point.
To use, import GuavaFutures._. This will bring an implicit into scope which will wrap a ListenableFuture with a RichListenableFuture, which provides the standard monadic operations (map, flatMap, foreach & withFilter) for ListenableFuture. See the tests for some examples how to use. This is basically to bring some of the benefits of Akka futures to Guava.
3.0.0