Future<T>::onTimeout(Duration, function<T()>, Timekeeper*=nullptr)
authorHans Fugal <fugalh@fb.com>
Wed, 4 Feb 2015 20:55:23 +0000 (12:55 -0800)
committerSara Golemon <sgolemon@fb.com>
Wed, 11 Feb 2015 02:01:59 +0000 (18:01 -0800)
commitdc64cee6a121dd91f5e992c86b0db184b8220b98
treecb1697ba29c2859a02b3cde9e8956cefdee80d83
parenteaed836c67e85c52837c9b78411db8c80228ce43
Future<T>::onTimeout(Duration, function<T()>, Timekeeper*=nullptr)

Summary:
(or func returns Future<T>)

Invoke and respond to a timeout with a callback, rather than using `within` and adding `onError` or `then` or something.

Test Plan: new tests

Reviewed By: davejwatson@fb.com

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

FB internal diff: D1763174

Tasks: 4548494

Signature: t1:1763174:1423074062:05cec1dfb1110b31b599033949ebe0ee70dd0552
folly/futures/Future-inl.h
folly/futures/Future.h
folly/futures/test/TimekeeperTest.cpp