Instance Methodswift-nio 2.72.0NIOCore
write(context:data:promise:)
Codec.swift:722func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
s7NIOCore20ByteToMessageHandlerCA2A014WriteObservingbcD7DecoderRzrlE5write7context4data7promiseyAA07ChannelE7ContextC_AA6NIOAnyVAA16EventLoopPromiseVyytGSgtF
What are these?
FNV24: [5H037]
where Decoder:WriteObservingByteToMessageDecoder
import NIOCore
The core abstractions that make up SwiftNIO.
final class ByteToMessageHandler<Decoder> where Decoder : ByteToMessageDecoder
A handler which turns a given ByteToMessageDecoder
into a ChannelInboundHandler
that can then be added to a ChannelPipeline
.
final class ChannelHandlerContext
Every ChannelHandler
has – when added to a ChannelPipeline
– a corresponding ChannelHandlerContext
which is the way ChannelHandler
s can interact with other ChannelHandler
s in the pipeline.
struct NIOAny
NIOAny
is an opaque container for values of any type, similar to Swift’s builtin Any
type. Contrary to Any
the overhead of NIOAny
depends on the the type of the wrapped value. Certain types that are important for the performance of a SwiftNIO application like ByteBuffer
, FileRegion
and AddressEnvelope<ByteBuffer>
can be expected to be wrapped almost without overhead. All others will have similar performance as if they were passed as an Any
as NIOAny
just like Any
will contain them within an existential container.
struct EventLoopPromise<Value>
A promise to provide a result later.
typealias Void = ()
The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
protocol WriteObservingByteToMessageDecoder : ByteToMessageDecoder
Some ByteToMessageDecoder
s need to observe write
s (which are outbound events). ByteToMessageDecoder
s which implement the WriteObservingByteToMessageDecoder
protocol will be notified about every outbound write.
typealias OutboundIn = Decoder.OutboundIn