netty/netty — pull request #2945 by fredericBregier (2014-09-29 08:12:39+00:00)
Title:  Proposal to extend Channel to support "softWritability"

Motivation:
As for autoRead, I think it could be useful to allow someone to set a
"softWritability" property to the channel. Doing this, this allow some
handlers to "soft" managed writabiity directly, not creating another
Attribute neither another event than current isWritable() and
channelWritabilityChanged().

Modifications:
Proposal to add 2 new methods to Channel (isSoftWritable and
softWritable) in order to manage this value, and change isWritable to
take into account this softWritable property.

Result:
When changing the current proposal implementation of
TrafficShapingHandler using user triggered event and specific
AttributKey to softWritability management and default
fireChannelWritabilityChanged, it works like a charm and does not need
those extra Attribute/user event. Could be used anywhere else too where
a "bufferisation" is made in front of the channel default bufferisation.