Add ability to silence callbacks for Subprocess::communicate
authorTudor Bosman <tudorb@fb.com>
Tue, 1 Apr 2014 17:36:27 +0000 (10:36 -0700)
committerSara Golemon <sgolemon@fb.com>
Fri, 4 Apr 2014 02:54:15 +0000 (19:54 -0700)
commit30c26b8fbc31bcb51a3c903a84ee54fb7d03f2c9
tree60dd6d7edf2969d40494865dba2d65bdfcd57489
parent2d08baf60cbd36d4bd0a112b574a8b755eeaa638
Add ability to silence callbacks for Subprocess::communicate

Summary:
Subprocess::communicate callbacks are level-triggered, which makes writing
"chatty" communication protocols difficult -- you often want to silence the
write callback until you read the expected message. Add
Subprocess::enableNotifications() for this purpose.

Test Plan: test added

Reviewed By: lucian@fb.com

FB internal diff: D1251564

@override-unit-failures
folly/Subprocess.cpp
folly/Subprocess.h
folly/test/SubprocessTest.cpp