Implement PhutilPHPObjectProtocolChannel and other channel changes
Summary:
See D2614. This is a small step toward providing some primitives to make "arc" (and other commands) use a more client/server architecture. See also D2841.
This adds four features to Channels:
- PhutilPHPObjectProtocolChannel, a protocol channel which transmits PHP objects as messages.
- PhutilSocketChannel::createNewPair(), which creates a pair of connected socket channels for testing.
- PhutilChannel::flush(), which blocks until writes complete (also useful for testing).
- Allows PhutilSocketChannel to accept separate read/write sockets (primarily useful for creating a socket channel on stdin/stdout).
Test Plan: Unit tests.
Reviewers: vrana
Reviewed By: vrana
CC: aran
Differential Revision: https://secure.phabricator.com/D2836