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?
✗ Incorrect
The correct keyword is
distributed actor to declare a distributed actor.What type of methods do distributed actors require for their remote calls?
✗ Incorrect
Distributed actor methods must be asynchronous because remote calls can take time and may fail.
What does the
id property in a distributed actor represent?✗ Incorrect
The
id uniquely identifies the distributed actor instance across different machines.Which of these is NOT a feature of distributed actors?
✗ Incorrect
Distributed actors do not share memory directly; they communicate via messages over the network.
Why are distributed actors useful?
✗ Incorrect
Distributed actors help write code that communicates safely and clearly across different devices or processes.
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.