title: Sending a message from one actor to another actor
body: <p>I'm new to Scala AKKA and am trying to code some simple examples. I have a simple example where a price update event is supposed to trigger a position update event. Here is the code:</p>
  
  <pre><code>import akka.actor.{Props, ActorSystem}
  
  object Main {
  
     def main(args: Array[String]): Unit = {
  
     val system = ActorSystem("system")
  
     val priceActor = system.actorOf(Props[PriceActor], "priceActor")
     val positionActor = system.actorOf(Props[PositionActor], "positionActor")
  
     priceActor ! "Update Price"
  
     }
  
  }
  
  
  class PositionActor extends Actor {
  
     val log = Logging(context.system, this)
  
     def receive = {
  
         case "Update Position" =&gt; log.info ("Position Updated")
         case _ =&gt; log.info("Received an unknown message")
  
     }
  
  }
  
  class PriceActor extends Actor {
  
      val log = Logging(context.system, this)
  
      def receive = {
  
          case "Update Price" =&gt; context.actorSelection("akka://system/user/positionActor")  ! "Update Position"
          case _ =&gt; log.info("Received an unknown message")
  
      }
  
  }
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li>Is it better to create PositionActor inside of PriceActor?</li>
  <li>In PriceActor, if I wanted to log a message that the price has been updated <em>and</em> send a message to PositionActor simulataneously, how would I do that?</li>
  </ol>