Skip to content

Commit f6076db

Browse files
committed
feat: Rename Extendable<Base>.Task
Extendable<Base>.Task -> Extendable<Base>.DispatchTask Avoid renaming with the Concurrency framework's `Task` structure in some cases
1 parent 8b284dc commit f6076db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/Core/Extensions/DispatchQueue+RAK.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010

1111
extension Extendable where Base: DispatchQueue {
12-
public typealias Task = (_ canceled: Bool) -> Void
12+
public typealias DispatchTask = (_ canceled: Bool) -> Void
1313

1414
/// Create a deferred task that can be canceled midway using the `cancel()` method.
1515
///
@@ -21,15 +21,15 @@ extension Extendable where Base: DispatchQueue {
2121
public static func after(
2222
_ time: DispatchTimeInterval,
2323
execute task: @escaping EmptyClosure
24-
) -> Task? {
24+
) -> DispatchTask? {
2525
func _after(block: @escaping EmptyClosure) {
2626
DispatchQueue.main.asyncAfter(deadline: .now() + time, execute: block)
2727
}
2828

2929
var taskAction: EmptyClosure? = task
30-
var result: Task?
30+
var result: DispatchTask?
3131

32-
let delayedClosure: Task = { canceled in
32+
let delayedClosure: DispatchTask = { canceled in
3333
if let action = taskAction, !canceled {
3434
DispatchQueue.main.async(execute: action)
3535
}
@@ -47,7 +47,7 @@ extension Extendable where Base: DispatchQueue {
4747
/// Cancel delayed tasks
4848
///
4949
/// - Parameter task: Task to be canceled
50-
public static func cancel(_ task: Task?) {
50+
public static func cancel(_ task: DispatchTask?) {
5151
task?(true)
5252
}
5353
}

0 commit comments

Comments
 (0)