DuplexConnection uses a subscriber to send frames along the underlying
connection. However, it makes no use of this subscriber other than onNext().
No implementation makes use of flow control, frames are always sent and always
received which makes onSubscribe() do nothing. The received frame flow control
is handled by the stream state machines. On top of that, terminating the output
subscriber does nothing, the underlying connection is kept active so a follow up
subscriber can attach and send frames. Which implies that onComplete() and
onError() are also unnecessary.
Replace it with a send(std::unique_ptr<folly::IOBuf>) method. This makes
things significantly simpler and keeps the same behavior that we have today.
DuplexConnection uses a subscriber to send frames along the underlying connection. However, it makes no use of this subscriber other than onNext(). No implementation makes use of flow control, frames are always sent and always received which makes onSubscribe() do nothing. The received frame flow control is handled by the stream state machines. On top of that, terminating the output subscriber does nothing, the underlying connection is kept active so a follow up subscriber can attach and send frames. Which implies that onComplete() and onError() are also unnecessary.
Replace it with a
send(std::unique_ptr<folly::IOBuf>)
method. This makes things significantly simpler and keeps the same behavior that we have today.