introduction draft

This commit is contained in:
Carl Fredrik Samson
2020-01-25 22:11:11 +01:00
parent dd4921d634
commit d0a018bfd1
25 changed files with 3923 additions and 4 deletions

View File

@@ -328,7 +328,7 @@ through the <code>Waker</code>. We'll get to know these in the following chapter
programmers meet when faced with async code, and still not dictate any
preferred runtime to actually do the scheduling and I/O queues.</p>
<p>It's important to know that Rust doesn't provide a runtime, so you have to choose
one. <a href="https://github.com/async-rs/async-std">async std</a> and <a href="">tokio</a> are two popular ones.</p>
one. <a href="https://github.com/async-rs/async-std">async std</a> and <a href="https://github.com/tokio-rs/tokio">tokio</a> are two popular ones.</p>
<p>With that out of the way, let's move on to our main example.</p>
<h1><a class="header" href="#naive-example" id="naive-example">Naive example</a></h1>
<pre><pre class="playpen"><code class="language-rust">use std::sync::atomic::{AtomicUsize, Ordering};
@@ -461,7 +461,7 @@ impl Drop for Reactor {
}
}
</code></pre></pre>
<pre><pre class="playpen"><code class="language-rust editable">use std::sync::atomic::{AtomicUsize, Ordering};
<pre><pre class="playpen"><code class="language-rust">use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::mpsc::{channel, Sender};
use std::sync::{Arc, Mutex};
use std::thread::{self, JoinHandle};