An apply method is a specially named Scala method that lets an object or class-like value be called using its enclosing name. Thus, ActorSystem(...) means ActorSystem.apply(...), and Wallet() means Wallet.apply(). section 2.2.2
Constructing an actor system
In ActorSystem(Wallet(), "wallet"), Wallet() invokes Wallet.apply(), while ActorSystem(...) invokes ActorSystem.apply(...). The resulting expression creates an actor system whose guardian behavior is Wallet(). section 2.2.2
Apply methods also make case-class instances usable where a function is expected. Worker.Parse(replyTo) is backed by a generated Worker.Parse.apply(replyTo); passing Worker.Parse lets the compiler supply that function in the ask request constructor. section 3.2.7
def apply[T](guardianBehavior: Behavior[T], name: String): ActorSystem[T]
The ActorSystem.apply signature shows the behavior and name parameters behind the concise ActorSystem(...) call. section 2.2.2
def apply(replyTo: ActorRef[Worker.Response]): Worker.Parse = new Worker.Parse(replyTo)
The generated Worker.Parse.apply method makes the case-class constructor available as the function required by ask. section 3.2.7
