We will create a simple console-based application that adds some quotes to the collection and then prints a random one. It will communicate by sending messages to actors. A message handler inside actors is not supposed to block, meaning it should not run code that takes time to complete in the same thread. Our actors adhere to this rule; both actors process messages directly and return immediately.
To demonstrate the working of both the actors, we will do something different for the main program. When sending a message to an actor, we will let the program wait for the reply before continuing with the program. We do this to ensure that all the quotes are added before we request one to be printed. We also want to print ...