mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Executors] Clean up how we unwrap the local executor of distributed custom actor (#64719)
This commit is contained in:
committed by
GitHub
parent
11b6249dc9
commit
edb66df377
@@ -278,19 +278,15 @@ public protocol DistributedActor: AnyActor, Identifiable, Hashable
|
||||
/// - Parameter system: `system` which should be used to resolve the `identity`, and be associated with the returned actor
|
||||
static func resolve(id: ID, using system: ActorSystem) throws -> Self
|
||||
|
||||
// FIXME: figure out how to remove this so LowerHopToActor can call the extension method directly on the protocol
|
||||
@available(SwiftStdlib 5.9, *)
|
||||
var _unwrapLocalUnownedExecutor: UnownedSerialExecutor { get }
|
||||
}
|
||||
|
||||
|
||||
@available(SwiftStdlib 5.9, *)
|
||||
extension DistributedActor {
|
||||
|
||||
@available(SwiftStdlib 5.9, *)
|
||||
public var _unwrapLocalUnownedExecutor: UnownedSerialExecutor {
|
||||
self.localUnownedExecutor!
|
||||
public func _getUnwrapLocalDistributedActorUnownedExecutor(_ actor: some DistributedActor) -> UnownedSerialExecutor {
|
||||
guard let executor = actor.localUnownedExecutor else {
|
||||
fatalError("Expected distributed actor executor to be not nil!")
|
||||
}
|
||||
|
||||
return executor
|
||||
}
|
||||
|
||||
// ==== Hashable conformance ---------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user