Skip to content

Commit

Permalink
Use swift-concurrency-task-manager (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii authored May 26, 2023
1 parent 6378255 commit 83f8423
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 888 deletions.
9 changes: 9 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
"revision" : "53a8adc54374f620002a3b6401d39e0feb3c57ae"
}
},
{
"identity" : "swift-concurrency-task-manager",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VergeGroup/swift-concurrency-task-manager",
"state" : {
"revision" : "2945db667991d84052b56901bf68b78d606d0699",
"version" : "1.0.0"
}
},
{
"identity" : "swift-docc-plugin",
"kind" : "remoteSourceControl",
Expand Down
17 changes: 2 additions & 15 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ let package = Package(
],
products: [
.library(name: "Verge", targets: ["Verge"]),
.library(name: "VergeTaskManager", targets: ["VergeTaskManager"]),
.library(name: "VergeTiny", targets: ["VergeTiny"]),
.library(name: "VergeORM", targets: ["VergeORM"]),
.library(name: "VergeRx", targets: ["VergeRx"]),
Expand All @@ -22,24 +21,19 @@ let package = Package(
.package(url: "https://github.com/apple/swift-docc-plugin.git", branch: "main"),
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.0.2"),
.package(url: "https://github.com/apple/swift-collections", branch: "main"),
.package(url: "https://github.com/VergeGroup/swift-concurrency-task-manager", from: "1.0.0"),

/// for testing
.package(url: "https://github.com/nalexn/ViewInspector.git", from: "0.9.3"),
],
targets: [
.target(
name: "VergeTaskManager",
dependencies: [
// .product(name: "Atomics", package: "swift-atomics")
]
),
.target(name: "VergeTiny", dependencies: []),
.target(
name: "Verge",
dependencies: [
.product(name: "Atomics", package: "swift-atomics"),
.product(name: "DequeModule", package: "swift-collections"),
"VergeTaskManager",
.product(name: "ConcurrencyTaskManager", package: "swift-concurrency-task-manager"),
]
),
.target(
Expand All @@ -64,13 +58,6 @@ let package = Package(
.product(name: "RxCocoa", package: "RxSwift"),
]
),
.testTarget(
name: "VergeTaskManagerTests",
dependencies: [
"VergeTaskManager",
"Verge",
]
),
.testTarget(
name: "VergeClassicTests",
dependencies: ["VergeClassic"]
Expand Down
40 changes: 0 additions & 40 deletions Sources/Verge/Library/AsyncReducer.swift

This file was deleted.

10 changes: 5 additions & 5 deletions Sources/Verge/Store/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import Foundation
import os.log
import VergeTaskManager
import ConcurrencyTaskManager

@_implementationOnly import Atomics

Expand Down Expand Up @@ -354,8 +354,8 @@ extension Store {
*/
@discardableResult
public func task<Return>(
key: VergeTaskManager.TaskKey = .distinct(),
mode: VergeTaskManager.TaskManagerActor.Mode = .dropCurrent,
key: ConcurrencyTaskManager.TaskKey = .distinct(),
mode: ConcurrencyTaskManager.TaskManagerActor.Mode = .dropCurrent,
priority: TaskPriority = .userInitiated,
@_inheritActorContext _ action: @Sendable @escaping () async throws -> Return
) -> Task<Return, Error> {
Expand Down Expand Up @@ -384,8 +384,8 @@ extension Store {
*/
@discardableResult
public func taskDetached<Return>(
key: VergeTaskManager.TaskKey = .distinct(),
mode: VergeTaskManager.TaskManagerActor.Mode = .dropCurrent,
key: ConcurrencyTaskManager.TaskKey = .distinct(),
mode: ConcurrencyTaskManager.TaskManagerActor.Mode = .dropCurrent,
priority: TaskPriority = .userInitiated,
_ action: @Sendable @escaping () async throws -> Return
) -> Task<Return, Error> {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Verge/Verge.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

@_exported import VergeTaskManager
@_exported import ConcurrencyTaskManager
@_exported import Combine
Loading

0 comments on commit 83f8423

Please sign in to comment.