title: paho mqtt on_message callback thread
body: <p>I implemented a paho-mqtt client to do a specific task when a message arrives. Therefore I use the on_message callback function like that:</p>
  <pre><code>def on_message():
      do time-intensive things
  </code></pre>
  <p>The callbacks run in one thread in the background because I use a non-blocking loop for mqtt.</p>
  <p>My question is what exactly happens in this thread? do those tasks collect in a row every time on_message is called ? Because in my case weird things happen: the tasks just interrupt each other</p>
  <p>Does someone know how to use async in this case ? I tried sth. like</p>
  <pre><code>def on_message():
     await time-intensive_task
  </code></pre>
  <p>But one can't call await in a non-async function</p>
  <p>please help</p>