Implement a segmented OutboundQueue
Internal lifecycle of a queue segment is disconnected. With this
implementation users do not observe queue changes until channel
shutdown, when the reported queue changes to null.
The reason for that is that the segments are managed internally without
the need to synchronize with the Netty thread. That synchronization is
performed only when there are multiple segments -- which is typical for
crossing the request count barrier.
Outbound queue manager is taght to not schedule a flush task it the
current state of the channel indicates that scheduling is not needed,
such as when the channel is not writable.
Change-Id: I037e27c00524e2a6ec218e3e7c1a5d6188b25ae8
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
d7755318c0395f3f74ca580f4e2db963976776aa)