This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Testing | |
import Combine | |
// From https://stackoverflow.com/questions/78892734/getting-task-isolated-value-of-type-async-passed-as-a-strongly-trans/78899940#78899940 | |
public final class AsyncFuture<Output, Failure: Error>: Publisher, Sendable { | |
public typealias Promise = @Sendable (Result<Output, Failure>) -> Void | |
private let work: @Sendable (@escaping Promise) async -> Void | |
public init(_ work: @Sendable @escaping (@escaping Promise) async -> Void) { |