Use fork merged in ForkedActor act

This commit is contained in:
Leif 2022-09-22 18:41:37 -06:00
parent 7682617694
commit b087274990
1 changed files with 2 additions and 7 deletions

View File

@ -36,13 +36,8 @@ public struct ForkedActor<Value: Actor> {
/// Asynchronously resolve the fork using the actor /// Asynchronously resolve the fork using the actor
@discardableResult @discardableResult
public func act() async throws -> Value { public func act() async throws -> Value {
try await Task.withCheckedCancellation { try await fork.merged { _, _ in
async let leftForkedTask = fork.left() actor
async let rightForkedTask = fork.right()
_ = try await [leftForkedTask, rightForkedTask]
return actor
} }
} }
} }