0
0
Swiftprogramming~5 mins

Distributed actors overview in Swift - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a distributed actor in Swift?
A distributed actor is a special kind of actor designed to work across different processes or machines, allowing safe and structured communication between them.
Click to reveal answer
intermediate
How do distributed actors differ from regular actors in Swift?
Distributed actors can communicate across network boundaries and handle remote calls, while regular actors work only within the same process.
Click to reveal answer
beginner
What keyword is used to declare a distributed actor in Swift?
The keyword distributed actor is used to declare a distributed actor.
Click to reveal answer
intermediate
What is the role of the id property in distributed actors?
The id property uniquely identifies a distributed actor instance across the network, enabling remote references.
Click to reveal answer
beginner
Why must distributed actor methods be asynchronous?
Because calls to distributed actors may involve network communication, their methods are asynchronous to handle delays and possible failures safely.
Click to reveal answer
Which keyword declares a distributed actor in Swift?
Aremote actor
Bdistributed actor
Cnetwork actor
Dasync actor
What type of methods do distributed actors require for their remote calls?
ASynchronous methods
BStatic methods
CAsynchronous methods
DPrivate methods
What does the id property in a distributed actor represent?
AThe actor's local memory address
BThe actor's type name
CThe actor's creation timestamp
DA unique identifier for the actor instance across the network
Which of these is NOT a feature of distributed actors?
ADirect memory sharing between actors
BRemote method calls across machines
CAutomatic network failure handling
DSafe concurrency within a single process
Why are distributed actors useful?
AThey allow safe, structured communication between processes or machines
BThey make synchronous calls faster
CThey replace all network protocols
DThey simplify writing concurrent code only on one device
Explain what distributed actors are and why they are important in Swift concurrency.
Think about how actors work locally versus across machines.
You got /4 concepts.
    Describe the role of the id property in distributed actors and how it helps remote communication.
    Consider how you find a friend in a big city using their unique address.
    You got /3 concepts.