Timed wait for futures
authorMatt Dordal <mnd@fb.com>
Tue, 3 Jun 2014 17:57:38 +0000 (10:57 -0700)
committerAnton Likhtarov <alikhtarov@fb.com>
Mon, 9 Jun 2014 22:35:49 +0000 (15:35 -0700)
commita91af7b36690a227816b515f3f32e999dcb23e40
tree50a4152eefbaae076e5e553d43cc83e989a03c79
parent19ec26e17d9ae63f7c8527f05cde889d560451f2
Timed wait for futures

Summary:
It might be useful to be able to wait for some time (but not forever) on a
future, so this is a shot at doing that. It's a very heavyweight implementation, however.

Since the current interface for waitWithSemaphore doesn't really make sense if
the timeout fires, change it to return a Future<T>.

Test Plan: unit tests

Reviewed By: hans@fb.com

Subscribers: trunkagent, folly@lists, fugalh

FB internal diff: D1358230
folly/wangle/Future-inl.h
folly/wangle/Future.h
folly/wangle/test/FutureTest.cpp