mkodekar / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Need for a TimeoutFuture #1875

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Guava concurrency library has a great possible use case for testing async 
code.  We have a great deal of test cases in which we are waiting for async 
event to occur, but need a timebox.  

This future could do things such as wait for a reply message to be received 
(polling for a variable to change from null to a value, or a collection to have 
a certain size, for a trite example), and the creation of the future would 
accept a time value in the constructor.  It might need a specific interface 
like the FutureCallback- onSuccess, onFailure, and onTimeOut.

Original issue reported on code.google.com by drober...@gmail.com on 30 Jan 2015 at 6:17

GoogleCodeExporter commented 9 years ago
Already fixed at head and should be available in the next guava release.  See

https://github.com/google/guava/blob/master/guava/src/com/google/common/util/con
current/Futures.java#L587

Original comment by lu...@google.com on 30 Jan 2015 at 6:19