Live-coding a Rust crate for asynchronous SSH connections
Let's build a Rust crate that provides asynchronous SSH connections! The ultimate goal is to use this in the EC2 crate we've been live-coding (https://www.youtube.com/playlist?list=PLqbS7AVVErFgY2faCIYjJZv_RluGkTlKt), but this video (and the crate we're building) is fairly independent of that. We're doing a deep-dive into futures (0.1) and tokio (pre-tokio reform) by implementing AsyncRead and AsyncWrite for multiple channels multiplexed onto a single thrussh (https://docs.rs/thrussh/) SSH connection.
This video is intended for users who are already somewhat familiar with Rust, but who want to see something larger and more involved be built. You can see earlier related videos (on the EC2 crate) in this playlist: https://www.youtube.com/playlist?list=PLqbS7AVVErFgY2faCIYjJZv_RluGkTlKt.
If you enjoyed this, go follow me on Twitter, or on Patreon at https://www.patreon.com/jonhoo to see announcements for new videos! Given that we didn't finish the crate in this video, there will be at least one more on coding it up, plus one where we weave it into the EC2 crate we built previously.
Some useful chunking points:
0:00:00 Recap + setting up target example code
0:31:58 Starting implementation
3:19:22 AsyncRead works! Exit status handling
3:36:03 Implicitly driving backing connection
4:57:52 Propagating errors from spawned future
5:02:24 Starting implementation of AsyncWrite
The code is available here: https://github.com/jonhoo/async-ssh
Other Videos By Jon Gjengset
2018-11-17 | The What and How of Futures and async/await in Rust |
2018-11-15 | Building a ranked-choice voting site for new stream ideas |
2018-09-30 | Rust open-source contributions stream |
2018-09-01 | Desktop and editor setup for Rust development |
2018-07-29 | Building an asynchronous ZooKeeper client in Rust (part 3) |
2018-07-15 | Building an asynchronous ZooKeeper client in Rust (part 2) |
2018-07-01 | Building an asynchronous ZooKeeper client in Rust |
2018-06-02 | Live-coding a linked hash map in Rust |
2018-05-20 | Live-coding a Rust crate for cancellable services |
2018-03-31 | Live-coding an asynchronous Rust crate for short EC2 jobs (part 3) |
2018-03-17 | Live-coding a Rust crate for asynchronous SSH connections |
2018-02-24 | Live-coding a Rust crate for short EC2 jobs (part 2) |
2018-02-10 | Live-coding a Rust crate for short EC2 jobs (part 1) |