Skip to content

Commit 20f28f8

Browse files
committed
[Distributed] make RemoteCallTarget Hashable, add availability
1 parent 3ff972b commit 20f28f8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

stdlib/public/Distributed/DistributedActorSystem.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import Swift
1313
import _Concurrency
1414

15+
/// A distributed actor system
1516
@available(SwiftStdlib 5.7, *)
1617
public protocol DistributedActorSystem: Sendable {
1718
/// The identity used by actors that communicate via this transport
@@ -340,7 +341,7 @@ extension DistributedActorSystem {
340341
/// The string representation will attempt to pretty print the target identifier,
341342
/// however its exact format is not specified and may change in future versions.
342343
@available(SwiftStdlib 5.7, *)
343-
public struct RemoteCallTarget: CustomStringConvertible {
344+
public struct RemoteCallTarget: CustomStringConvertible, Hashable {
344345
private let _identifier: String
345346

346347
public init(_ identifier: String) {
@@ -407,6 +408,7 @@ func _executeDistributedTarget<D: DistributedTargetInvocationDecoder>(
407408
/// Note that the decoding will be provided the specific types that the sending side used to preform the call,
408409
/// so decoding can rely on simply invoking e.g. `Codable` (if that is the `SerializationRequirement`) decoding
409410
/// entry points on the provided types.
411+
@available(SwiftStdlib 5.7, *)
410412
public protocol DistributedTargetInvocationEncoder {
411413
associatedtype SerializationRequirement
412414

@@ -418,7 +420,7 @@ public protocol DistributedTargetInvocationEncoder {
418420
// ///
419421
// /// Record an argument of `Argument` type.
420422
// /// This will be invoked for every argument of the target, in declaration order.
421-
// mutating func recordArgument<Argument: SerializationRequirement>(name: String, _ argument: Argument) throws
423+
// mutating func recordArgument<Argument: SerializationRequirement>(_ argument: Argument) throws
422424

423425
/// Record the error type of the distributed method.
424426
/// This method will not be invoked if the target is not throwing.
@@ -433,8 +435,12 @@ public protocol DistributedTargetInvocationEncoder {
433435
mutating func doneRecording() throws
434436
}
435437

438+
@available(SwiftStdlib 5.7, *)
439+
public
440+
436441
/// Decoder that must be provided to `executeDistributedTarget` and is used
437442
/// by the Swift runtime to decode arguments of the invocation.
443+
@available(SwiftStdlib 5.7, *)
438444
public protocol DistributedTargetInvocationDecoder {
439445
associatedtype SerializationRequirement
440446

0 commit comments

Comments
 (0)