title: "RuntimeException: a facade root has not been set"
body: <p>I'm having an issue in a Laravel Zero project I'm working on. I'm working on a command that handles direct file transfers between 2 disks—1 SFTP and another local.</p>
  <p>I have configured both correctly and tested that I'm able to transfer files between them using the <code>Storage</code> code below. My issue pops up when I try to do this using the <code>spatie/async</code> package to create a pool of concurrent transfers (or maybe just the way I'm trying to do it).</p>
  <pre class="lang-php prettyprint-override"><code>$pool = Pool::create()
          -&gt;concurrency($limit);
  
  $progress = $this-&gt;output-&gt;createProgressBar($file_list);
  
  if(!Storage::disk('local')-&gt;exists($local_folder_path)) {
      Storage::disk('local')-&gt;makeDirectory($local_folder_path);
  }
  
  foreach($file_list as $filename =&gt; $remote_path) {
      $pool-&gt;add(function() use ($remote_path, $filename, $local_folder_path) {
          Storage::disk('local')
              -&gt;writeStream(
                  &quot;{$local_folder_path}/{$filename}&quot;,
                   Storage::disk('remote')-&gt;readStream($remote_path)
              );
  
          return $filename;
      })-&gt;then(function($filename) use (&amp;$progress) {
          $this-&gt;info(&quot;{$filename} downloaded&quot;);
          $progress-&gt;advance();
      })-&gt;catch(function($exception) {
          $this-&gt;error($exception);
      });
  }
  
  $pool-&gt;wait();
  $progress-&gt;finish();
  </code></pre>
  <p>By the way, the error, <code>RuntimeException: a facade root has not been set</code>, is being printed to my console via the <code>catch()</code> handler for the first item in the pool. I did discover that much.</p>
  <p>I've searched for answers to this issue, but all of the articles and other SO/Stack Exchange postings I've come across didn't seem even similar to whatever's causing my issue.</p>
  <p>Thanks in advance for any help.</p>