Skip to content

Commit

Permalink
Update availability to include macOS 10.15 etc (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler authored Aug 23, 2022
1 parent 748103f commit 3938593
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
//
//===----------------------------------------------------------------------===//

#if compiler(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)

import NIOCore

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension HBStreamerProtocol {
/// AsyncSequence of ByteBuffers version of streamed Request body
public var sequence: HBRequestBodyStreamerSequence { return .init(streamer: self) }
}

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension HBByteBufferStreamer {
/// Consume what has been fed to the request so far
public func consume() async throws -> HBStreamerOutput {
Expand All @@ -32,7 +32,7 @@ extension HBByteBufferStreamer {
}
}

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension HBStaticStreamer {
/// Consume what has been fed to the request so far
public func consume() -> HBStreamerOutput {
Expand All @@ -47,7 +47,7 @@ extension HBStaticStreamer {
}

/// AsyncSequence providing ByteBuffers from a request body stream
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public struct HBRequestBodyStreamerSequence: AsyncSequence {
public typealias Element = ByteBuffer

Expand Down
4 changes: 2 additions & 2 deletions Sources/HummingbirdCore/Request/ByteBufferStreamer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public protocol HBStreamerProtocol: HBSendable {
/// - Returns: EventLoopFuture that will be fulfilled when all buffers are consumed
func consumeAll(on eventLoop: EventLoop, _ process: @escaping (ByteBuffer) -> EventLoopFuture<Void>) -> EventLoopFuture<Void>

#if compiler(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
func consume() async throws -> HBStreamerOutput

#endif // compiler(>=5.5) && canImport(_Concurrency)
Expand Down
4 changes: 2 additions & 2 deletions Tests/HummingbirdCoreTests/CoreTests+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

#if compiler(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)

import HummingbirdCore
import HummingbirdCoreXCT
Expand All @@ -21,7 +21,7 @@ import NIOPosix
import NIOTransportServices
import XCTest

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
final class HummingBirdCoreAsyncTests: XCTestCase {
static var eventLoopGroup: EventLoopGroup!

Expand Down

0 comments on commit 3938593

Please sign in to comment.