(wangle) Timeouts basic
authorHans Fugal <fugalh@fb.com>
Fri, 26 Dec 2014 23:18:11 +0000 (15:18 -0800)
committerDave Watson <davejwatson@fb.com>
Mon, 29 Dec 2014 18:40:32 +0000 (10:40 -0800)
commitd1be08e3f87525f513c2d7a61c9c770afaef95bc
tree37e4117f14a1c55ca0a7d44a96d1c965d035c59a
parent062bc87d14e1135bff6ee43edc5f3a40d9ee5943
(wangle) Timeouts basic

Summary:
Add basic timeout functionality. This adds `futures::sleep` which makes an async Future that finishes after the given duration, and `Future::get` which blocks on the result and takes an optional timeout.

Introducing the folly::wangle::futures namespace (soon to be just folly::futures) which will hold our wangle utility functions, the things that live in the Future object in Twitter's scala code. We'll probably move when* and wait-ish methods in here too, and perhaps alias makeFuture-ish methods too, though James has me mostly convinced not to deprecate them at the folly::wangle level (because they're basically Future constructors and Future lives at folly::wangle)

`Future::delayed` after Twitter's helper of the same name

Test Plan: new and old unit tests

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, fugalh, exa, folly-diffs@

FB internal diff: D1748894

Tasks: 4548494

Signature: t1:1748894:1419363496:1f4a62ec8455989c1fcce845695ace1d01c101c8
folly/wangle/futures/Future-inl.h
folly/wangle/futures/Future.cpp [new file with mode: 0644]
folly/wangle/futures/Future.h
folly/wangle/futures/Timekeeper.h [new file with mode: 0644]
folly/wangle/futures/WangleException.h
folly/wangle/futures/detail/Dummy.cpp [deleted file]
folly/wangle/futures/detail/ThreadWheelTimekeeper.cpp [new file with mode: 0644]
folly/wangle/futures/detail/ThreadWheelTimekeeper.h [new file with mode: 0644]
folly/wangle/futures/detail/Types.h [new file with mode: 0644]
folly/wangle/futures/test/TimekeeperTest.cpp [new file with mode: 0644]