title: Does WordPress Cron API Run in the Background?
body: <p>I'm reading the code of <code>cron.php</code> in wp-includes and <code>spawn_cron()</code> seems to be the one which actually executes registered tasks.</p>
  
  <p>The last two lines of the function:</p>
  
  <pre><code>$cron_url = site_url( 'wp-cron.php?doing_wp_cron=' . $doing_wp_cron );
  
  wp_remote_post( $cron_url, array( 'timeout' =&gt; 0.01, 'blocking' =&gt; false, 'sslverify' =&gt; apply_filters( 'https_local_ssl_verify', true ) ) );
  </code></pre>
  
  <p>It simply opens wp-cron.php passing a task an as a query argument. </p>
  
  <p>The description of the API at the top of cron.php: </p>
  
  <pre><code>* Schedules a hook which will be executed once by the WordPress actions core at 
  * a time which you specify. The action will fire off when someone visits your
  * WordPress site, if the schedule time has passed.`
  </code></pre>
  
  <p>My question is that let's say the visitor opens one of the pages of the site and then the registered task is fired by the cron API. And if the task is heavy and takes several minutes to complete, does the visitor gets a page that is not completely loaded until the task finishes? </p>
  
  <p>[Edit]
  To clarify what I'm asking, the question is, does the WP Cron API run tasks after the page loading completes?</p>