         switch event {
         case let .value(_, isCompleted):
             if isCompleted {
-                transition(to: .completed)
+                terminate(reason: .finished)
             }
         case .progress:
             break // Simply send the event
         case .error:
-            transition(to: .failed)
+            terminate(reason: .finished)
         }
 
         for context in subscriptions.values {

        }
    }

    // MARK: - State Transition

    private func transition(to state: State) {
        guard !isDisposed else { return }

        self.state = state
        if state == .cancelled {
            operation?.cancel()
            dependency?.unsubscribe()
            onCancelled?()
        }
        onDisposed?() // All states except for `executing` are final
    }

    // MARK: - Priority

        }
    }

    /// A task might have a dependency. The task automatically unsubscribes
    /// from the dependency when it gets cancelled, and also updates the
    /// priority of the subscription to the dependency when its own
    /// priority is updated.
