Folly::FutureDAG <-> Gossit
authorShayan Mohanty <shayanjm@fb.com>
Sat, 9 Jul 2016 00:12:44 +0000 (17:12 -0700)
committerFacebook Github Bot 1 <facebook-github-bot-1-bot@fb.com>
Sat, 9 Jul 2016 00:24:10 +0000 (17:24 -0700)
commit2f9865aa90e91cb20a3ebf7545bd7036e2cd8102
treeed58844a1fde8413e3efc79f5b79e5a7c45a7b41
parent804743d804519c53215f77cd402b8f0cbc869c40
Folly::FutureDAG <-> Gossit

Summary:
Implements remove(), state_clean(), and reset() functions in order to allow for static FutureDAGS that can be modified in place and executed multiple times.

remove() removes the given handle from the nodes vector and cleans up all dependencies associated with it. Because of the way Handles are implemented, all Handles greater than the one removed are decremented (and therefore must be accounted for in the client-code). Current best-practice would be to remove nodes by most-recently added.

state_clean() removes the sink/source nodes added by go().

reset() removes all nodes but the top-level source node and resets dependency properties.

Reviewed By: tjkswaine

Differential Revision: D3486947

fbshipit-source-id: c8b9db6a139ee5b36aae6e9366c9b338cc49ede1
folly/experimental/FutureDAG.h
folly/experimental/test/FutureDAGTest.cpp