Polymorphic Functor implementation in Folly::FutureDAG
authorShayan Mohanty <shayanjm@fb.com>
Thu, 11 Aug 2016 02:15:36 +0000 (19:15 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Thu, 11 Aug 2016 02:23:27 +0000 (19:23 -0700)
commit61aaac8908fc518ee1d5f8cfe2ff316fd9ccfd59
tree850323e4f79a3200a06dedd9e7094686a496db6a
parent18aab9241fad1238171b1d849f7765ec6100c593
Polymorphic Functor implementation in Folly::FutureDAG

Summary:
Implements a polymorphic functor for FutureDAGs. In order for FutureDAGs to be stateful they must be wrapped by a class of some sort. This is a really common pattern which we've been using in Gossit (and further - across the RedWood stack) in order to maintain state, and we feel it's generalized enough to be useful elsewhere.

`state` is an instance of the type declared in the template, and the exec* methods wrap go().get() so client-side implementations only have to touch the functor after construction in order to drive their DAGs.

Reviewed By: tjkswaine

Differential Revision: D3685651

fbshipit-source-id: 81169aefcff13ac8cc6cbb6bef6d90047732ad8a
folly/experimental/FutureDAG.h