From 5e595a8ebd803bd4bc6de742d90b57d7d2a3026e Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Fri, 2 Nov 2018 18:18:02 -0700 Subject: [PATCH] Fix typo in task ID tracking parameter --- .../Executor/ConcurrentSequenceExecutor.swift | 10 +++++----- .../Executor/ConcurrentSequenceExecutorTests.swift | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Concurrency/Executor/ConcurrentSequenceExecutor.swift b/Sources/Concurrency/Executor/ConcurrentSequenceExecutor.swift index 132dbae..5a7be21 100644 --- a/Sources/Concurrency/Executor/ConcurrentSequenceExecutor.swift +++ b/Sources/Concurrency/Executor/ConcurrentSequenceExecutor.swift @@ -27,15 +27,15 @@ public class ConcurrentSequenceExecutor: SequenceExecutor { /// - parameter name: The name of the executor. /// - parameter qos: The quality of service of this executor. This /// defaults to `userInitiated`. - /// - parameter shouldTackTaskId: `true` if task IDs should be tracked + /// - parameter shouldTrackTaskId: `true` if task IDs should be tracked /// as tasks are executed. `false` otherwise. By tracking the task IDs, /// if waiting on the completion of a task sequence times out, the /// reported error contains the ID of the task that was being executed /// when the timeout occurred. The tracking does incur a minor /// performance cost. This value defaults to `false`. - public init(name: String, qos: DispatchQoS = .userInitiated, shouldTackTaskId: Bool = false) { + public init(name: String, qos: DispatchQoS = .userInitiated, shouldTrackTaskId: Bool = false) { taskQueue = DispatchQueue(label: "Executor.taskQueue-\(name)", qos: qos, attributes: .concurrent) - self.shouldTackTaskId = shouldTackTaskId + self.shouldTrackTaskId = shouldTrackTaskId } /// Execute a sequence of tasks concurrently from the given initial task. @@ -58,7 +58,7 @@ public class ConcurrentSequenceExecutor: SequenceExecutor { // MARK: - Private private let taskQueue: DispatchQueue - private let shouldTackTaskId: Bool + private let shouldTrackTaskId: Bool private func execute(_ task: Task, with sequenceHandle: SynchronizedSequenceExecutionHandle, _ execution: @escaping (Task, Any) -> SequenceExecution) { taskQueue.async { @@ -66,7 +66,7 @@ public class ConcurrentSequenceExecutor: SequenceExecutor { return } - if self.shouldTackTaskId { + if self.shouldTrackTaskId { sequenceHandle.willBeginExecuting(taskId: task.id) } diff --git a/Tests/ConcurrencyTests/Executor/ConcurrentSequenceExecutorTests.swift b/Tests/ConcurrencyTests/Executor/ConcurrentSequenceExecutorTests.swift index 866ddc8..7936e36 100644 --- a/Tests/ConcurrencyTests/Executor/ConcurrentSequenceExecutorTests.swift +++ b/Tests/ConcurrencyTests/Executor/ConcurrentSequenceExecutorTests.swift @@ -122,7 +122,7 @@ class ConcurrentSequenceExecutorTests: XCTestCase { } func test_executeSequence_withNonTerminatingSequence_withTimeout_verifyAwaitTimeout() { - let executor = ConcurrentSequenceExecutor(name: "test_executeSequence_withNonTerminatingSequence_withTimeout_verifyAwaitTimeout", shouldTackTaskId: true) + let executor = ConcurrentSequenceExecutor(name: "test_executeSequence_withNonTerminatingSequence_withTimeout_verifyAwaitTimeout", shouldTrackTaskId: true) let sequencedTask = MockSelfRepeatingTask(id: 123) { return 0