title: Is Akka Ask Blocking on the Current Thread
body: <p>I have a scenario where I have to fetch the details of a user by his id. It is a HTTP request that comes in and in my HTTP handler layer, I make use of the id that I get from the request, send a message to the actor which then talks to the database service to fetch the user. </p>
  
  <p>Now since this is a HTTP request, I need to satisfy the request by sending a response back. So I thought of using the Akka ask pattern, but I have the following questions in mind:</p>
  
  <ol>
  <li><p>Is this going to block on my current thread? </p></li>
  <li><p>Is using ask pattern here to fetch a user in my case a scalable solution? I mean, I could have a few hundreds to a million users calling this end point at any given point in time. Is this a good idea to use the ask pattern to fetch a user?</p></li>
  </ol>
  
  <p>In code, it looks like this in my HTTP controller</p>
  
  <pre><code>val result: Future[Any] = userActor ? FetchUser(id)
  </code></pre>
  
  <p>In my actor, I would do the following:</p>
  
  <pre><code>case fetchUser: FetchUser =&gt; sender ! myService.getUser(fetchUser.id)
  </code></pre>