Skip to content

Commit

Permalink
Adopt AsyncAlgorithms (#167)
Browse files Browse the repository at this point in the history
# Motivation

Now that `swift-async-algorithms` has a `1.0.0` tag we can depend on it instead of shipping our own version of `merge`.
  • Loading branch information
FranzBusch authored Dec 5, 2023
1 parent d673fdc commit 026ed0d
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 1,432 deletions.
16 changes: 5 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let package = Package(
from: "1.0.0"
),
.package(
url: "https://github.com/apple/swift-collections.git",
url: "https://github.com/apple/swift-async-algorithms.git",
from: "1.0.0"
),
],
Expand All @@ -46,7 +46,10 @@ let package = Package(
name: "Logging",
package: "swift-log"
),
.target(name: "_AsyncMergeSequence"),
.product(
name: "AsyncAlgorithms",
package: "swift-async-algorithms"
),
.target(name: "UnixSignals"),
.target(name: "ConcurrencyHelpers"),
]
Expand All @@ -66,15 +69,6 @@ let package = Package(
.target(
name: "ConcurrencyHelpers"
),
.target(
name: "_AsyncMergeSequence",
dependencies: [
.product(
name: "DequeModule",
package: "swift-collections"
),
]
),
.testTarget(
name: "ServiceLifecycleTests",
dependencies: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import _AsyncMergeSequence
import AsyncAlgorithms

extension AsyncSequence where Self: Sendable, Element: Sendable {
/// Creates an asynchronous sequence that is cancelled once graceful shutdown has triggered.
Expand Down Expand Up @@ -44,7 +44,7 @@ public struct AsyncCancelOnGracefulShutdownSequence<Base: AsyncSequence & Sendab

@inlinable
public init(base: Base) {
self._merge = .init(
self._merge = merge(
base.mapNil().map { .base($0) },
AsyncGracefulShutdownSequence().mapNil().map { _ in .gracefulShutdown }
)
Expand Down
155 changes: 0 additions & 155 deletions Sources/_AsyncMergeSequence/Locking.swift

This file was deleted.

108 changes: 0 additions & 108 deletions Sources/_AsyncMergeSequence/Merge/AsyncMerge2Sequence.swift

This file was deleted.

Loading

0 comments on commit 026ed0d

Please sign in to comment.