title: How to handle callbacks in Python 3?
body: <p>I have a custom HTTP method/verb (lets say <code>LISTEN</code>) which allows me to listen for an update on a resource stored on a remote server. The API available for this has a blocking call which will get my client code to listen for an update till I interrupt the execution of that call. Just to provide an example, if I were to perform a curl as follows:</p>
  
  <pre><code>curl -X LISTEN http://&lt;IP-Address&gt;:&lt;Port&gt;/resource
  </code></pre>
  
  <p>The execution of this creates a blocking call, providing me updates on the resource whenever a new value for this resource is pushed to the server (similar to a pub-sub model), the response for that would look similar to this:</p>
  
  <pre><code>{"data":"value update 1","id":"id resource"}
  {"data":"value update 2","id":"id resource"}
  (...)
  </code></pre>
  
  <p>If I were to write code to handle this in Python, how do I call my url using this custom verb and handle the blocking call/call back while ensuring that this does not block the execution of the rest of my code?</p>