Skip to content

Commit

Permalink
Rename downStream to downstream (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
s2mr authored Jun 22, 2023
1 parent b339466 commit ac9309b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ final class CombineLatestStorage<
base1: base1,
base2: base2,
base3: base3,
downStreamContinuation: continuation
downstreamContinuation: continuation
)

case .resumeContinuation(let downstreamContinuation, let result):
Expand Down Expand Up @@ -108,7 +108,7 @@ final class CombineLatestStorage<
base1: Base1,
base2: Base2,
base3: Base3?,
downStreamContinuation: StateMachine.DownstreamContinuation
downstreamContinuation: StateMachine.DownstreamContinuation
) {
// This creates a new `Task` that is iterating the upstream
// sequences. We must store it to cancel it at the right times.
Expand Down Expand Up @@ -350,6 +350,6 @@ final class CombineLatestStorage<
}
}

stateMachine.taskIsStarted(task: task, downstreamContinuation: downStreamContinuation)
stateMachine.taskIsStarted(task: task, downstreamContinuation: downstreamContinuation)
}
}
8 changes: 4 additions & 4 deletions Sources/AsyncAlgorithms/Debounce/DebounceStateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ struct DebounceStateMachine<Base: AsyncSequence, C: Clock> {
/// Actions returned by `clockSleepFinished()`.
enum ClockSleepFinishedAction {
/// Indicates that the downstream continuation should be resumed with the given element.
case resumeDownStreamContinuation(
downStreamContinuation: UnsafeContinuation<Result<Element?, Error>, Never>,
case resumeDownstreamContinuation(
downstreamContinuation: UnsafeContinuation<Result<Element?, Error>, Never>,
element: Element
)
}
Expand Down Expand Up @@ -547,8 +547,8 @@ struct DebounceStateMachine<Base: AsyncSequence, C: Clock> {
bufferedElement: nil
)

return .resumeDownStreamContinuation(
downStreamContinuation: downstreamContinuation,
return .resumeDownstreamContinuation(
downstreamContinuation: downstreamContinuation,
element: currentElement.element
)
} else {
Expand Down
4 changes: 2 additions & 2 deletions Sources/AsyncAlgorithms/Debounce/DebounceStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ final class DebounceStorage<Base: AsyncSequence, C: Clock>: @unchecked Sendable
let action = self.stateMachine.withCriticalRegion { $0.clockSleepFinished() }

switch action {
case .resumeDownStreamContinuation(let downStreamContinuation, let element):
downStreamContinuation.resume(returning: .success(element))
case .resumeDownstreamContinuation(let downstreamContinuation, let element):
downstreamContinuation.resume(returning: .success(element))

case .none:
break
Expand Down
6 changes: 3 additions & 3 deletions Sources/AsyncAlgorithms/Zip/ZipStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final class ZipStorage<Base1: AsyncSequence, Base2: AsyncSequence, Base3: AsyncS
base1: base1,
base2: base2,
base3: base3,
downStreamContinuation: continuation
downstreamContinuation: continuation
)

case .resumeUpstreamContinuations(let upstreamContinuations):
Expand Down Expand Up @@ -96,7 +96,7 @@ final class ZipStorage<Base1: AsyncSequence, Base2: AsyncSequence, Base3: AsyncS
base1: Base1,
base2: Base2,
base3: Base3?,
downStreamContinuation: StateMachine.DownstreamContinuation
downstreamContinuation: StateMachine.DownstreamContinuation
) {
// This creates a new `Task` that is iterating the upstream
// sequences. We must store it to cancel it at the right times.
Expand Down Expand Up @@ -315,6 +315,6 @@ final class ZipStorage<Base1: AsyncSequence, Base2: AsyncSequence, Base3: AsyncS
}
}

stateMachine.taskIsStarted(task: task, downstreamContinuation: downStreamContinuation)
stateMachine.taskIsStarted(task: task, downstreamContinuation: downstreamContinuation)
}
}

0 comments on commit ac9309b

Please sign in to comment.