write(context:data:promise:)
ChannelHandlers.swift:248func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
s7NIOCore16IdleStateHandlerC5write7context4data7promiseyAA07ChannelD7ContextC_AA6NIOAnyVAA16EventLoopPromiseVyytGSgtF
What are these?56SO3
import NIOCore
The core abstractions that make up SwiftNIO.
final class IdleStateHandler
Triggers an IdleStateEvent when a Channel has not performed read, write, or both operation for a while.
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(readTimeout: TimeAmount? = nil, writeTimeout: TimeAmount? = nil, allTimeout: TimeAmount? = nil)
let allTimeout: TimeAmount?
let readTimeout: TimeAmount?
let writeTimeout: TimeAmount?
func channelActive(context: ChannelHandlerContext)
func channelRead(context: ChannelHandlerContext, data: NIOAny)
func channelReadComplete(context: ChannelHandlerContext)
func handlerAdded(context: ChannelHandlerContext)
func handlerRemoved(context: ChannelHandlerContext)
enum IdleStateEvent
A user event triggered by IdleStateHandler when a Channel is idle.
typealias InboundIn = NIOAny
typealias InboundOut = NIOAny
typealias OutboundIn = NIOAny
typealias OutboundOut = NIOAny