title: How to get actor messages from stdin?
body: <p>I would like to know if it's possible (and how) to get an akka actor to receive messages from stdin. Essentially, the idea would be for every line of input to be sent as a message to the actor, e.g.</p>
  
  <pre><code>&gt; myprogram
  DO X
  DO Y
  ...
  </code></pre>
  
  <p>and then to have the actor receive messages "DO X", "DO Y", etc.</p>
  
  <p>Is there a standard solution to do this?</p>
  
  <p>I guess one way would be to do this:</p>
  
  <pre><code>spawn {
      while(in.available) {
          actor ! in.readLine
      }
  }
  </code></pre>
  
  <p>But then I'd have two actors (or one actor-based task and one actor) and I'd be using blocking IO (is that safe with actors, by the way?)... Also, it makes it harder to control the spawn block (e.g. to kill the task).</p>
  
  <p><strong>Added further follow ups from OP</strong></p>
  
  <p>I have a couple follow ups, if you will allow me...</p>
  
  <ol>
  <li><p>Is there a performance hit using this solution (i.e. does <code>CamelServiceManager</code> start a lot of things? HTTP server, etc.)?</p></li>
  <li><p>Got a good tutorial for beginners? I started reading <a href="http://doc.akka.io/docs/akka/current/scala/camel.html" rel="nofollow">Camel</a> from the official Akka documentation, but it seems to assume more knowledge of Camel than I currently possess. For instance, I couldn't figure out how to use a custom <code>java.io.InputStream</code> as <code>endpointUri</code>.</p></li>
  </ol>