title: How to run an asynchronous task from a non-main thread in Tokio?
body: <pre class="lang-rust prettyprint-override"><code>use std::thread;
  use tokio::task; // 0.3.4
  
  #[tokio::main]
  async fn main() {
      thread::spawn(|| {
          task::spawn(async {
              println!(&quot;123&quot;);
          });
      })
      .join();
  }
  </code></pre>
  <p>When compiling I get a warning:</p>
  <pre class="lang-none prettyprint-override"><code>warning: unused `std::result::Result` that must be used
    --&gt; src/main.rs:6:5
     |
  6  | /     thread::spawn(|| {
  7  | |         task::spawn(async {
  8  | |             println!(&quot;123&quot;);
  9  | |         });
  10 | |     })
  11 | |     .join();
     | |____________^
     |
     = note: `#[warn(unused_must_use)]` on by default
     = note: this `Result` may be an `Err` variant, which should be handled
  </code></pre>
  <p>And when executing I get an error:</p>
  <pre class="lang-none prettyprint-override"><code>thread '&lt;unnamed&gt;' panicked at 'must be called from the context of Tokio runtime configured with either `basic_scheduler` or `threaded_scheduler`', src/main.rs:7:9
  </code></pre>