title: Python socketio | Wait for response before emitting another message
body: <p>Say I have a client and a server machine both running a Python program connected with <code>socketio</code>. I want to send a message from the client machine to the server machine and the server would send a response to the client.</p>
  <p>What if I want to prevent my client from sending other messages until the server responds? Are there any simple ways to do this.</p>
  <p>I'm thinking about using a global flag in the client machine that turns true whenever the client sends a message and turns back to false whenever the client receives the response. However, I think this is quite error-prone and &quot;hacky.&quot;</p>