Subprocess: allow non-copyable callbacks
Summary:Instead of std::function<bool(int, int)>, use folly::Function to
pass callbacks to Subprocess::communicate. This makes it possible
to pass non-copyable callables, which is especially interesting
because Subprocess::readLinesCallback returns a non-copyable
object.
This diff also fixes the forwarding of the callback passed to
readLinesCallback in case you pass an lvalue reference.
Reviewed By: snarkmaster
Differential Revision:
D3169956
fb-gh-sync-id:
7a906f9a3ab50502fc04e0d83a23ca5e0201bb3e
fbshipit-source-id:
7a906f9a3ab50502fc04e0d83a23ca5e0201bb3e