title: Return from function if execution finished within timeout or make callback otherwise
body: <p>I have a project in Python 3.5 without any usage of asynchronous features. I have to implement the folowing logic:</p>
  
  <pre><code>def should_return_in_3_sec(some_serious_job, arguments, finished_callback):
      # Start some_serious_job(*arguments) in a task
      # if it finishes within 3 sec:
      #    return result immediately
      # otherwise return None, but do not terminate task.
      # If the task finishes in 1 minute:
      #    call finished_callback(result)
      # else:
      #    call finished_callback(None)
      pass
  </code></pre>
  
  <p>The function <code>should_return_in_3_sec()</code> should remain synchronous, but it is up to me to write any new asynchronous code (including <code>some_serious_job()</code>).</p>
  
  <p>What is the most elegant and pythonic way to do it?</p>