make wait() and friends return reference to self instead of new Future
Summary: we still make the new Future, but assign it to ourselves. this avoids the following buggy pattern that people might expect to work ``` auto f = ... f.wait(); // Careful. f.value() was moved out into the new Future, so you may have lost something someOperationOn(f.value()); // Nope. We already set a callback internally in wait() f.then(...); ``` Test Plan: unit Reviewed By: davejwatson@fb.com Subscribers: exa, yfeldblum, trunkagent, fbcode-common-diffs@, sammerat, cold-storage-diffs@, folly-diffs@, jsedgwick, aflock FB internal diff: D1809040 Tasks: 6048284 Signature: t1:1809040:1422900812:1b416408eb5eaa71e88778c9c22ed8bfba087efe
Showing
Please register or sign in to comment