Skip to content

Commit 51ae967

Browse files
authored
SWIFT-1408 Remove conditional definition on Linux for async/await APIs (#713)
1 parent 124c535 commit 51ae967

17 files changed

+73
-35
lines changed

Sources/MongoSwift/AsyncAwait/ChangeStream+AsyncSequence.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `ChangeStream` to support async/await APIs.
3+
@available(macOS 12, *)
34
extension ChangeStream: AsyncSequence, AsyncIteratorProtocol {
45
public typealias AsyncIterator = ChangeStream
56

Sources/MongoSwift/AsyncAwait/ClientSession+AsyncAwait.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `ClientSession` to support async/await APIs.
3+
@available(macOS 12, *)
34
extension ClientSession {
45
/**
56
* Starts a multi-document transaction for all subsequent operations in this session.

Sources/MongoSwift/AsyncAwait/MongoClient+AsyncAwait.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `MongoClient` to support async/await APIs.
3+
@available(macOS 12, *)
34
extension MongoClient {
45
/**
56
* Closes this `MongoClient`, closing all connections to the server and cleaning up internal state.

Sources/MongoSwift/AsyncAwait/MongoCollection+AsyncAwait.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await APIs.
3+
@available(macOS 12, *)
34
extension MongoCollection {
45
/**
56
* Drops this collection from its parent database.

Sources/MongoSwift/AsyncAwait/MongoCollection+ChangeStreams+AsyncAwait.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await change stream APIs.
3+
@available(macOS 12, *)
34
extension MongoCollection {
45
/**
56
* Starts a `ChangeStream` on a collection. The `CollectionType` will be associated with the `fullDocument`

Sources/MongoSwift/AsyncAwait/MongoCollection+FindAndModify+AsyncAwait.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await find and modify APIs.
3+
@available(macOS 12, *)
34
extension MongoCollection {
45
/**
56
* Finds a single document and deletes it, returning the original.

Sources/MongoSwift/AsyncAwait/MongoCollection+Indexes+AsyncAwait.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await index management APIs.
3+
@available(macOS 12, *)
34
extension MongoCollection {
45
/**
56
* Creates an index over the collection for the provided keys with the provided options.

Sources/MongoSwift/AsyncAwait/MongoCollection+Read+AsyncAwait.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await read APIs.
3+
@available(macOS 12, *)
34
extension MongoCollection {
45
/**
56
* Finds the documents in this collection which match the provided filter.

Sources/MongoSwift/AsyncAwait/MongoCollection+Write+AsyncAwait.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await write APIs.
3+
@available(macOS 12, *)
34
extension MongoCollection {
45
/**
56
* Encodes the provided value to BSON and inserts it. If the value is missing an identifier, one will be generated

Sources/MongoSwift/AsyncAwait/MongoCursor+AsyncSequence.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency) && os(Linux)
1+
#if compiler(>=5.5) && canImport(_Concurrency)
22
/// Extension to `MongoCursor` to support async/await APIs.
3+
@available(macOS 12, *)
34
extension MongoCursor: AsyncSequence, AsyncIteratorProtocol {
45
public typealias AsyncIterator = MongoCursor
56

0 commit comments

Comments
 (0)