title: Erlang gen_server with long-running tasks
body: <p>Good day,</p>
  
  <p>I have a <code>gen_server</code> process which does some long-running state-updating tasks periodically in
  <code>handle_info</code>:</p>
  
  <pre><code>handle_info(trigger, State) -&gt;
      NewState = some_long_running_task(),
      erlang:send_after(?LOOP_TIME, self(), trigger),
      {noreply, NewState}.
  </code></pre>
  
  <p>But when such task runs, then whole server gets unresponsive and any call to it leads to whole server crash:</p>
  
  <pre><code>my_gen_server:status().
  ** exception exit: {timeout,{gen_server,call,[my_gen_server,status]}}
       in function  gen_server:call/2
  </code></pre>
  
  <p>How it is possible to avoid blocking of gen_server ?
  And when one call <code>my_gen_server:status()</code> at any time, the result should be something like:
  <code>{ok, task_active}</code></p>