ChannelInboundInvoker
public protocol ChannelInboundInvoker
Fire inbound events related to a Channel
through the ChannelPipeline
until its end is reached or it’s consumed by a ChannelHandler
.
-
Declaration
Swift
func fireChannelRegistered()
-
Called once there is no more data to read immediately on a
Channel
. Any new data received will be handled later.Declaration
Swift
func fireChannelReadComplete()
-
Called when a
Channel
‘s writable state changes.The writability state of a Channel depends on watermarks that can be set via
Channel.setOption
and how much data is still waiting to be transferred to the remote peer. You should take care to enforce some kind of backpressure if the channel becomes unwritable which meansChannel.isWritable
will returnfalse
to ensure you do not consume too much memory due to queued writes. What exactly you should do here depends on the protocol and other semantics. But for example you may want to stop writing to theChannel
untilChannel.writable
becomestrue
again or stop reading at all.Declaration
Swift
func fireChannelWritabilityChanged()
-
Called when an inbound operation
Error
was caught.Be aware that for inbound operations this method is called while for outbound operations defined in
ChannelOutboundInvoker
theEventLoopFuture
orEventLoopPromise
will be notified.Declaration
Swift
func fireErrorCaught(_ error: Error)
Parameters
error
the error we encountered.
-
Trigger a custom user inbound event which will flow through the
ChannelPipeline
.Declaration
Swift
func fireUserInboundEventTriggered(_ event: Any)
Parameters
event
the event itself.