Files
swift-nio-http2/Sources/NIOHTTP2/HTTP2StreamDelegate.swift
T
Rick Newton-Rogers 78176ba277 Remove NIOHTTP2StreamDelegate Sendable requirement (#384)
Motivation:

Remove `NIOHTTP2StreamDelegate` `Sendable` conformance requirement.
This wasn't needed in the first place because `NIOHTTP2Handler`
is not `Sendable`, therefore it never leaves the thread on which it is
created.

The delegate may still be `Sendable` depending on the implementation
but it is not a strict requirement.

Modifications:

Remove NIOHTTP2StreamDelegate Sendable requirement

Result:

Sendable is no longer required for NIOHTTP2StreamDelegate conformance
2023-04-05 16:40:55 +01:00

27 lines
957 B
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
/// A delegate which can be used with the ``NIOHTTP2Handler`` and its multiplexer.
///
/// Delegates are called when the multiplexer creates or closes HTTP/2 streams.
public protocol NIOHTTP2StreamDelegate {
/// A new HTTP/2 stream was created with the given ID.
func streamCreated(_ id: HTTP2StreamID, channel: Channel)
/// An HTTP/2 stream with the given ID was closed.
func streamClosed(_ id: HTTP2StreamID, channel: Channel)
}