Skip to content

Commit 40704ac

Browse files
xedinktoso
authored andcommitted
[stdlib] Distributed: Promote remoteCall{Void} into protocol requirements
1 parent e40c66f commit 40704ac

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

stdlib/public/Distributed/DistributedActorSystem.swift

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ import _Concurrency
249249
/// - [SE-0336: Distributed Actor Isolation](https://github.com/apple/swift-evolution/blob/main/proposals/0336-distributed-actor-isolation.md)
250250
/// - [SE-0344: Distributed Actor Runtime](https://github.com/apple/swift-evolution/blob/main/proposals/0344-distributed-actor-runtime.md)
251251
@available(SwiftStdlib 5.7, *)
252-
public protocol DistributedActorSystem: Sendable {
252+
public protocol DistributedActorSystem<SerializationRequirement>: Sendable {
253253
/// The type ID that will be assigned to any distributed actor managed by this actor system.
254254
///
255255
/// ### A note on Codable IDs
@@ -375,47 +375,47 @@ public protocol DistributedActorSystem: Sendable {
375375
/// that are associated with this specific invocation.
376376
func makeInvocationEncoder() -> InvocationEncoder
377377

378-
// /// Invoked by the Swift runtime when making a remote call.
379-
// ///
380-
// /// The `arguments` are the arguments container that was previously created
381-
// /// by `makeInvocationEncoder` and has been populated with all arguments.
382-
// ///
383-
// /// This method should perform the actual remote function call, and await for its response.
384-
// ///
385-
// /// ## Errors
386-
// /// This method is allowed to throw because of underlying transport or serialization errors,
387-
// /// as well as by re-throwing the error received from the remote callee (if able to).
388-
// func remoteCall<Act, Err, Res>(
389-
// on actor: Act,
390-
// target: RemoteCallTarget,
391-
// invocation: inout InvocationEncoder,
392-
// throwing: Err.Type,
393-
// returning: Res.Type
394-
// ) async throws -> Res
395-
// where Act: DistributedActor,
396-
// Act.ID == ActorID,
397-
// Err: Error,
398-
// Res: SerializationRequirement
399-
400-
// /// Invoked by the Swift runtime when making a remote call.
401-
// ///
402-
// /// The `arguments` are the arguments container that was previously created
403-
// /// by `makeInvocationEncoder` and has been populated with all arguments.
404-
// ///
405-
// /// This method should perform the actual remote function call, and await for its response.
406-
// ///
407-
// /// ## Errors
408-
// /// This method is allowed to throw because of underlying transport or serialization errors,
409-
// /// as well as by re-throwing the error received from the remote callee (if able to).
410-
// func remoteCallVoid<Act, Err>(
411-
// on actor: Act,
412-
// target: RemoteCallTarget,
413-
// invocation: inout InvocationEncoder,
414-
// throwing: Err.Type
415-
// ) async throws -> Res
416-
// where Act: DistributedActor,
417-
// Act.ID == ActorID,
418-
// Err: Error
378+
/// Invoked by the Swift runtime when making a remote call.
379+
///
380+
/// The `arguments` are the arguments container that was previously created
381+
/// by `makeInvocationEncoder` and has been populated with all arguments.
382+
///
383+
/// This method should perform the actual remote function call, and await for its response.
384+
///
385+
/// ## Errors
386+
/// This method is allowed to throw because of underlying transport or serialization errors,
387+
/// as well as by re-throwing the error received from the remote callee (if able to).
388+
func remoteCall<Act, Err, Res>(
389+
on actor: Act,
390+
target: RemoteCallTarget,
391+
invocation: inout InvocationEncoder,
392+
throwing: Err.Type,
393+
returning: Res.Type
394+
) async throws -> Res
395+
where Act: DistributedActor,
396+
Act.ID == ActorID,
397+
Err: Error
398+
// Res: SerializationRequirement
399+
400+
/// Invoked by the Swift runtime when making a remote call.
401+
///
402+
/// The `arguments` are the arguments container that was previously created
403+
/// by `makeInvocationEncoder` and has been populated with all arguments.
404+
///
405+
/// This method should perform the actual remote function call, and await for its response.
406+
///
407+
/// ## Errors
408+
/// This method is allowed to throw because of underlying transport or serialization errors,
409+
/// as well as by re-throwing the error received from the remote callee (if able to).
410+
func remoteCallVoid<Act, Err>(
411+
on actor: Act,
412+
target: RemoteCallTarget,
413+
invocation: inout InvocationEncoder,
414+
throwing: Err.Type
415+
) async throws
416+
where Act: DistributedActor,
417+
Act.ID == ActorID,
418+
Err: Error
419419

420420
// Implementation notes:
421421
// The `metatype` must be the type of `Value`, and it must conform to

0 commit comments

Comments
 (0)