Structureswift-nio 2.72.0NIOCore
SynchronousOperations
A view of a ChannelPipeline
which may be used to invoke synchronous operations.
struct SynchronousOperations
All functions must be called from the pipeline’s event loop.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (47) members.
Types
enum Position
A
Position
within theChannelPipeline
used to insert handlers into theChannelPipeline
.
Type members
init(channel: Channel
) Create
ChannelPipeline
for a givenChannel
. This method should never be called by the end-user directly: it is only intended for use with customChannel
implementations. Users should always usechannel.pipeline
to access theChannelPipeline
for aChannel
.
Instance members
var debugDescription: String
let eventLoop: EventLoop
The
EventLoop
that is used by the underlyingChannel
.var syncOperations: SynchronousOperations
Returns a view of operations which can be performed synchronously on this pipeline. All operations must be called on the event loop.
func addHandler(ChannelHandler, name: String?, position: ChannelPipeline.Position
) -> EventLoopFuture<Void> Add a
ChannelHandler
to theChannelPipeline
.func addHandler(ChannelHandler & Sendable, name: String?, position: ChannelPipeline.Position
) async throws func addHandlers(ChannelHandler..., position: ChannelPipeline.Position
) -> EventLoopFuture<Void> Adds the provided channel handlers to the pipeline in the order given, taking account of the behaviour of
ChannelHandler.add(first:)
.func addHandlers([ChannelHandler], position: ChannelPipeline.Position
) -> EventLoopFuture<Void> Adds the provided channel handlers to the pipeline in the order given, taking account of the behaviour of
ChannelHandler.add(first:)
.func addHandlers((ChannelHandler & Sendable)..., position: ChannelPipeline.Position
) async throws func addHandlers([ChannelHandler & Sendable], position: ChannelPipeline.Position
) async throws func bind(to: SocketAddress, promise: EventLoopPromise<Void>?
) func close(mode: CloseMode, promise: EventLoopPromise<Void>?
) func connect(to: SocketAddress, promise: EventLoopPromise<Void>?
) func containsHandler(name: String
) -> EventLoopFuture<Void> Returns if the
ChannelHandler
of the given type is contained in the pipeline.func containsHandler<Handler>(type: Handler.Type
) -> EventLoopFuture<Void> Returns if the
ChannelHandler
of the given type is contained in the pipeline.func context(handler: ChannelHandler
) -> EventLoopFuture<ChannelHandlerContext> Returns the
ChannelHandlerContext
that belongs to aChannelHandler
.func context<Handler>(handlerType: Handler.Type
) -> EventLoopFuture<ChannelHandlerContext> Returns the
ChannelHandlerContext
that belongs to aChannelHandler
of the given type.func context(name: String
) -> EventLoopFuture<ChannelHandlerContext> Returns the
ChannelHandlerContext
that belongs to aChannelHandler
.func fireChannelActive(
) func fireChannelInactive(
) func fireChannelRead(NIOAny
) func fireChannelReadComplete(
) func fireChannelRegistered(
) func fireChannelUnregistered(
) func fireChannelWritabilityChanged(
) func fireErrorCaught(Error
) func fireUserInboundEventTriggered(Any
) func flush(
) func handler<Handler>(type: Handler.Type
) -> EventLoopFuture<Handler> Returns the first
ChannelHandler
of the given type.func read(
) func register(promise: EventLoopPromise<Void>?
) func removeHandler(RemovableChannelHandler
) -> EventLoopFuture<Void> Remove a
ChannelHandler
from theChannelPipeline
.func removeHandler(RemovableChannelHandler & Sendable
) async throws func removeHandler(RemovableChannelHandler, promise: EventLoopPromise<Void>?
) Remove a
ChannelHandler
from theChannelPipeline
.func removeHandler(context: ChannelHandlerContext
) -> EventLoopFuture<Void> Remove a
ChannelHandler
from theChannelPipeline
.func removeHandler(context: ChannelHandlerContext
) async throws func removeHandler(context: ChannelHandlerContext, promise: EventLoopPromise<Void>?
) Remove a
ChannelHandler
from theChannelPipeline
.func removeHandler(name: String
) -> EventLoopFuture<Void> Remove a
ChannelHandler
from theChannelPipeline
.func removeHandler(name: String
) async throws func removeHandler(name: String, promise: EventLoopPromise<Void>?
) Remove a
ChannelHandler
from theChannelPipeline
.func triggerUserOutboundEvent(Any, promise: EventLoopPromise<Void>?
) func write(NIOAny, promise: EventLoopPromise<Void>?
) func writeAndFlush(NIOAny, promise: EventLoopPromise<Void>?
)
Citizens in NIOCore
Instance members
var eventLoop: EventLoop
The
EventLoop
of theChannel
this synchronous operations view corresponds to.func addHandler(ChannelHandler, name: String?, position: ChannelPipeline.Position
) throws Add a handler to the pipeline.
func addHandlers(ChannelHandler..., position: ChannelPipeline.Position
) throws Add one or more handlers to the pipeline.
func addHandlers([ChannelHandler], position: ChannelPipeline.Position
) throws Add an array of handlers to the pipeline.
func bind(to: SocketAddress, promise: EventLoopPromise<Void>?
) Fires
bind
from the tail to the head.func close(mode: CloseMode, promise: EventLoopPromise<Void>?
) Fires
close
from the tail to the head.func connect(to: SocketAddress, promise: EventLoopPromise<Void>?
) Fires
connect
from the tail to the head.func context(handler: ChannelHandler
) throws -> ChannelHandlerContext Returns the
ChannelHandlerContext
for the given handler instance if it is in theChannelPipeline
, if it exists.func context<Handler>(handlerType: Handler.Type
) throws -> ChannelHandlerContext Returns the
ChannelHandlerContext
for the handler of given type, if one exists.func context(name: String
) throws -> ChannelHandlerContext Returns the
ChannelHandlerContext
for the handler with the given name, if one exists.func fireChannelActive(
) Fires
channelActive
from the head to the tail.func fireChannelInactive(
) Fires
channelInactive
from the head to the tail.func fireChannelRead(NIOAny
) Fires
channelRead
from the head to the tail.func fireChannelReadComplete(
) Fires
channelReadComplete
from the head to the tail.func fireChannelRegistered(
) Fires
channelRegistered
from the head to the tail.func fireChannelUnregistered(
) Fires
channelUnregistered
from the head to the tail.func fireChannelWritabilityChanged(
) Fires
channelWritabilityChanged
from the head to the tail.func fireErrorCaught(Error
) Fires
errorCaught
from the head to the tail.func fireUserInboundEventTriggered(Any
) Fires
userInboundEventTriggered
from the head to the tail.func flush(
) Fires
flush
from the tail to the head.func handler<Handler>(type: Handler.Type
) throws -> Handler Returns the
ChannelHandler
of the given type from theChannelPipeline
, if it exists.func read(
) Fires
read
from the tail to the head.func register(promise: EventLoopPromise<Void>?
) Fires
register
from the tail to the head.func removeHandler(RemovableChannelHandler
) -> EventLoopFuture<Void> Remove a
ChannelHandler
from theChannelPipeline
.func triggerUserOutboundEvent(Any, promise: EventLoopPromise<Void>?
) Fires
triggerUserOutboundEvent
from the tail to the head.func write(NIOAny, promise: EventLoopPromise<Void>?
) Fires
write
from the tail to the head.func writeAndFlush(NIOAny, promise: EventLoopPromise<Void>?
) Fires
writeAndFlush
from the tail to the head.
Available in NIOHTTP1
Instance members
func addHTTPClientHandlers(position: ChannelPipeline.Position, leftOverBytesStrategy: RemoveAfterUpgradeStrategy, enableOutboundHeaderValidation: Bool, encoderConfiguration: HTTPRequestEncoder.Configuration, withClientUpgrade: NIOHTTPClientUpgradeConfiguration?
) throws Configure a
ChannelPipeline
for use as a HTTP client.func addHTTPClientHandlers(position: ChannelPipeline.Position, leftOverBytesStrategy: RemoveAfterUpgradeStrategy, enableOutboundHeaderValidation: Bool, withClientUpgrade: NIOHTTPClientUpgradeConfiguration?
) throws Configure a
ChannelPipeline
for use as a HTTP client.func addHTTPClientHandlers(position: ChannelPipeline.Position, leftOverBytesStrategy: RemoveAfterUpgradeStrategy, withClientUpgrade: NIOHTTPClientUpgradeConfiguration?
) throws Configure a
ChannelPipeline
for use as a HTTP client with a client upgrader configuration.func configureHTTPServerPipeline(position: ChannelPipeline.Position, withPipeliningAssistance: Bool, withServerUpgrade: NIOHTTPServerUpgradeConfiguration?, withErrorHandling: Bool
) throws Configure a
ChannelPipeline
for use as a HTTP server.func configureHTTPServerPipeline(position: ChannelPipeline.Position, withPipeliningAssistance: Bool, withServerUpgrade: NIOHTTPServerUpgradeConfiguration?, withErrorHandling: Bool, withOutboundHeaderValidation: Bool
) throws Configure a
ChannelPipeline
for use as a HTTP server.func configureHTTPServerPipeline(position: ChannelPipeline.Position, withPipeliningAssistance: Bool, withServerUpgrade: NIOHTTPServerUpgradeConfiguration?, withErrorHandling: Bool, withOutboundHeaderValidation: Bool, withEncoderConfiguration: HTTPResponseEncoder.Configuration
) throws Configure a
ChannelPipeline
for use as a HTTP server.func configureUpgradableHTTPClientPipeline<UpgradeResult>(configuration: NIOUpgradableHTTPClientPipelineConfiguration<UpgradeResult>
) throws -> EventLoopFuture<UpgradeResult> Configure a
ChannelPipeline
for use as an HTTP client.func configureUpgradableHTTPServerPipeline<UpgradeResult>(configuration: NIOUpgradableHTTPServerPipelineConfiguration<UpgradeResult>
) throws -> EventLoopFuture<UpgradeResult> Configure a
ChannelPipeline
for use as an HTTP server.