handle(value:logger:)
Handle upgrade result output from channel
func handle(value: Value, logger: Logger) async
upgradeResult: The upgrade result output by Channel
logger: Logger to use
Handle upgrade result output from channel
func handle(value: Value, logger: Logger) async
s20HummingbirdWebSocket05HTTP1bC14UpgradeChannelV6handle5value6loggeryAC5ValueV_7Logging6LoggerVtYaF
What are these?8DATB
upgradeResult: The upgrade result output by Channel
logger: Logger to use
import HummingbirdWebSocket
struct HTTP1WebSocketUpgradeChannel
Child channel supporting a web socket upgrade from HTTP1
struct Value
struct Logger
A Logger
is the central type in SwiftLog
. Its central function is to emit log messages using one of the methods corresponding to a log level.
init(responder: @escaping HTTPChannelHandler.Responder, configuration: WebSocketServerConfiguration, additionalChannelHandlers: @escaping () -> [any RemovableChannelHandler] = { [] }, shouldUpgrade: @escaping (HTTPRequest, Channel, Logger) async throws -> ShouldUpgradeResult<WebSocketDataHandler<Context>>)
Initialize HTTP1AndWebSocketChannel with async shouldUpgrade
function
init(responder: @escaping HTTPChannelHandler.Responder, configuration: WebSocketServerConfiguration, additionalChannelHandlers: @escaping () -> [any RemovableChannelHandler] = { [] }, shouldUpgrade: @escaping (HTTPRequest, Channel, Logger) throws -> ShouldUpgradeResult<WebSocketDataHandler<Context>>)
Initialize HTTP1AndWebSocketChannel with synchronous shouldUpgrade
function
init<WSResponder>(responder: @escaping HTTPChannelHandler.Responder, webSocketResponder: WSResponder, configuration: WebSocketServerConfiguration, additionalChannelHandlers: @escaping () -> [any RemovableChannelHandler] = { [] }) where WSResponder : HTTPResponder, WSResponder.Context : WebSocketRequestContext
Initialize HTTP1WebSocketUpgradeChannel with async shouldUpgrade
function
let responder: HTTPChannelHandler.Responder
func setup(channel: Channel, logger: Logger) -> EventLoopFuture<Value>
Setup channel to accept HTTP1 with a WebSocket upgrade
struct Context
Basic context implementation of WebSocketContext
. Used by non-router web socket handle function
enum UpgradeResult
Upgrade result (either a websocket AsyncChannel, or an HTTP1 AsyncChannel)
typealias WebSocketChannelHandler = (NIOAsyncChannel<WebSocketFrame, WebSocketFrame>, Logger) async -> Void
init(responder: @escaping HTTPChannelHandler.Responder, additionalChannelHandlers: @escaping () -> [any RemovableChannelHandler] = { [] }, configuration: WebSocketServerConfiguration, shouldUpgrade: @escaping (HTTPRequest, Channel, Logger) async throws -> ShouldUpgradeResult<WebSocketDataHandler<Context>>)