(wangle) cold via
authorHans Fugal <fugalh@fb.com>
Tue, 1 Jul 2014 00:29:05 +0000 (17:29 -0700)
committerTudor Bosman <tudorb@fb.com>
Mon, 7 Jul 2014 15:42:22 +0000 (08:42 -0700)
commit73e3273b9f2f2f5686e2b6ff4a87d572f2391585
treefbc17b4c4cc44691d86f63d890e5aacc699afc73
parent03f412789821e5c1892dea9c887e0ecd63e1c705
(wangle) cold via

Summary:
Instead of returning a Later, `via` returns a cold future.
This works without keeping a backreference like Later does, because an inactive Future will always activate on destruction. Alternatively we could have an extra Promise, a la Later, and pass that along like Later does, and require launch() at the end (though, implicit launching on destruction would be an option there too).

If you think this approach is viable I'll clean it up on Wednesday: make sure all the calling sites work, etc.

Test Plan:
new unit test
This may fail in contbuild, I haven't done the codemod for calling sites, if there are any.

Reviewed By: hannesr@fb.com

Subscribers: jsedgwick, net-systems@, fugalh, exa

FB internal diff: D1412499

Tasks: 4480567
folly/wangle/Future-inl.h
folly/wangle/Future.h
folly/wangle/Later.h
folly/wangle/README.md
folly/wangle/ThreadGate.h
folly/wangle/detail/State.h
folly/wangle/test/FutureTest.cpp
folly/wangle/test/LaterTest.cpp