Use fork merged in ForkedActor act
This commit is contained in:
parent
7682617694
commit
b087274990
|
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue