title: Actix Websocket seems to process requests serially
body: <p>I have the StreamHandler that processes incoming requests from a server like the following snippet. The problem I'm having is that the <code>handle</code> function won't take a new element until the previous request is done. How can I execute requests concurrently? I tried to execute it in a separate thread like <code>thread:spawn</code> but the requests still got processed serially. The full code is here: <a href="https://github.com/hussachai/the-rusty-mole/blob/master/src/client/ws_client.rs#L161" rel="nofollow noreferrer">https://github.com/hussachai/the-rusty-mole/blob/master/src/client/ws_client.rs#L161</a></p>
  <pre><code>impl StreamHandler&lt;Result&lt;Frame, WsProtocolError&gt;&gt; for WebSocketClient {
  
  fn handle(&amp;mut self, msg: Result&lt;Frame, WsProtocolError&gt;, ctx: &amp;mut Context&lt;Self&gt;) {
      if let Ok(Frame::Binary(data)) = msg {
          ctx.address().do_send(client::BuildRequest { data: data.to_vec() });
      }
  }
  
  fn started(&amp;mut self, _ctx: &amp;mut Context&lt;Self&gt;) {
      info!(&quot;Connected&quot;);
  }
  
  fn finished(&amp;mut self, ctx: &amp;mut Context&lt;Self&gt;) {
      info!(&quot;Server disconnected&quot;);
      ctx.stop()
  }
  </code></pre>
  <p>}</p>