Skip to content

Commit e1527ff

Browse files
ktosokavon
andauthored
Update stdlib/public/Distributed/DistributedActorSystem.swift
Co-authored-by: Kavon Farvardin <[email protected]>
1 parent 20e1834 commit e1527ff

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

stdlib/public/Distributed/DistributedActorSystem.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -851,16 +851,16 @@ public struct RemoteCallArgument<Value> {
851851
/// ```
852852
///
853853
/// ### Decoding DistributedActor arguments using Codable
854-
/// When using the actor system's ``ActorID`` is ``Codable``, every distributed actor using that system
854+
/// When using an actor system where ``ActorID`` is ``Codable``, every distributed actor using that system
855855
/// is also implicitly ``Codable`` (see ``DistributedActorSystem``). Such distributed actors are encoded
856-
/// as their ``ActorID`` stored in a ``Encoder/singleValueContainer``. Since ``Codable`` is being used
857-
/// by this such system, it means that the ``decodeNextArgument`` method will be using ``Decoder`` to
858-
/// decode the incoming values, some of which may be distributed actors.
856+
/// as their ``ActorID`` stored in an ``Encoder/singleValueContainer``. When ``Codable`` is being used
857+
/// by such a system, the ``decodeNextArgument`` method will be using ``Decoder`` to
858+
/// decode the incoming values, which may themselves be distributed actors.
859859
///
860-
/// In order for a distributed actor's ``Decodable/init(from:)`` to be able to return an existing instance,
861-
/// i.e. when the being-decoded ``ActorID`` actually references a locally hosted distributed actor, that the
862-
/// current actor system can return from `resolve(id:as:)`, an actor system must be provided to the ``Decoder``.
863-
/// This is done by setting the actor system the decoding is performed for, on the decoder's `userInfo`, as follows:
860+
/// An actor system must be provided to the ``Decoder`` in order for a distributed actor's ``Decodable/init(from:)``
861+
/// to be able to return the instance of the actor. Specifically, the decoded``ActorID`` is passed to the actor system's `resolve(id:as:)` method in order to
862+
/// return either a local instance identified by this ID, or creating a remote actor reference.
863+
/// Thus, you must set the actor system the decoding is performed for, on the decoder's `userInfo`, as follows:
864864
///
865865
/// ```
866866
/// mutating func decodeNextArgument<Argument: SerializationRequirement>() throws -> Argument {
@@ -869,7 +869,7 @@ public struct RemoteCallArgument<Value> {
869869
/// decoder.userInfo[.actorSystemKey] = self.actorSystem
870870
/// return try Argument.decode(
871871
/// }
872-
// ```
872+
/// ```
873873
@available(SwiftStdlib 5.7, *)
874874
public protocol DistributedTargetInvocationDecoder {
875875
/// The serialization requirement that the types passed to `decodeNextArgument` are required to conform to.

0 commit comments

Comments
 (0)