write(context:data:promise:)
HTTPServerPipelineHandler.swift:405func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
s8NIOHTTP125HTTPServerPipelineHandlerC5write7context4data7promisey7NIOCore07ChannelD7ContextC_AH6NIOAnyVAH16EventLoopPromiseVyytGSgtF
What are these?XKX0
import NIOHTTP1
final class HTTPServerPipelineHandler
A ChannelHandler
that handles HTTP pipelining by buffering inbound data until a response has been sent.
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 ()
.
init()
func channelInactive(context: ChannelHandlerContext)
func channelRead(context: ChannelHandlerContext, data: NIOAny)
func close(context: ChannelHandlerContext, mode: CloseMode, promise: EventLoopPromise<Void>?)
func errorCaught(context: ChannelHandlerContext, error: Error)
func handlerRemoved(context: ChannelHandlerContext)
func read(context: ChannelHandlerContext)
func userInboundEventTriggered(context: ChannelHandlerContext, event: Any)
struct ConnectionStateError
typealias InboundIn = HTTPServerRequestPart
typealias InboundOut = HTTPServerRequestPart
typealias OutboundIn = HTTPServerResponsePart
typealias OutboundOut = HTTPServerResponsePart