• Shayan Mohanty's avatar
    Polymorphic Functor implementation in Folly::FutureDAG · 61aaac89
    Shayan Mohanty authored
    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
    61aaac89
FutureDAG.h 6.03 KB