Skip to content

Rename downStream to downstream #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}