From Zero to Async Hero with Rust’s Tokio

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 64

  • @migom6
    @migom6 2 года назад +24

    RUclips needs more project based rust videos

  • @dabunnisher29
    @dabunnisher29 6 месяцев назад +1

    I think your channel is really GREAT for Rust learners like me. Thank you.

  • @shailendrajadhav8603
    @shailendrajadhav8603 Год назад

    I found this today and it is still relevant. Thank you for making this video!

  • @johnyepthomi892
    @johnyepthomi892 Год назад +1

    This is one of the best Rust video out there. Thank you for the effort that went into this. 👍

    • @chrishayuk
      @chrishayuk  Год назад +1

      very kind. i'm glad you like, it's a video i really struggled with (especially on the length and complexity), glad it worked out

  • @ashutoshgarg9126
    @ashutoshgarg9126 2 года назад +7

    Hey Chris I want to say thanks for this. Please can you consider more Rust-related content as the content for Rust learning is very less and Rust will be huge in the future. And so far I only came across the @let's get Rusty (which is really good) youtube channel for learning. I think you know Rust good enough for Rust topics and project videos

    • @chrishayuk
      @chrishayuk  2 года назад +8

      heyyy, glad you like. i am planning to do more rust content on the channel this year. you'll have seen 2 rust vids already now this year (and 2 from last year). so there will definitely be a lot more than last year.

  • @zaspanyflegmatyk2446
    @zaspanyflegmatyk2446 2 года назад +5

    Great video! Finally, something that lets me relate to my C/C++ and Python exp without making me dive into gazillion async tokio functions that are wrappers around basic networking/io stuff! Thanks!

    • @chrishayuk
      @chrishayuk  2 года назад

      Glad you liked. It was definitely a hard video to do, and got complicated towards then end

  • @DJenriqez
    @DJenriqez 2 года назад +2

    I really like, idea of code in front and you in background, it looks really nice in video

    • @chrishayuk
      @chrishayuk  2 года назад +1

      I’m glad you like, it’s became a bit of my style now

  • @hamishgilkison1027
    @hamishgilkison1027 2 года назад +3

    Thanks. I coded along, and learned a lot. I'd definitely watch more like this. I haven't found many Rust tutorials at this level; they're normally either quite basic or hardcore. This is a good bridge.
    Also, from NZ and TIL Sirocco.

  • @ArunManivannan
    @ArunManivannan 2 года назад +1

    Extremely helpful tutorial, Chris. Thanks for taking your time to do this.

    • @chrishayuk
      @chrishayuk  2 года назад

      glad it was useful. i'm always pleased when i see comments on this tutorial :) , was a tough one to build

  • @nsgirish
    @nsgirish Год назад +1

    Excellent and crystal clear explanation. Thanks sir

    • @chrishayuk
      @chrishayuk  Год назад

      Glad it was useful, it was a particular difficult video to try and strike the balance with

  • @apexwins2087
    @apexwins2087 2 года назад +1

    Thank you so much, great video, I'm a beginner and I love how you explain everything that's happening. Can't wait to go through more of your content, would love to see more videos of the Tokio stack like Axum. Thank you!

    • @chrishayuk
      @chrishayuk  2 года назад

      Glad it was useful. I keep meaning to do Axum

  • @eparch2144
    @eparch2144 Год назад +1

    I'm really learning a lot from your excellent instruction. Thank you!

    • @chrishayuk
      @chrishayuk  Год назад

      You're very welcome!, glad it’s useful

  • @SalvaToroTorus
    @SalvaToroTorus Год назад +1

    Nicely done on the transformation of a std library to a tokio implementation, however you could achieve exactly the same using threads:
    // loop through incoming connections
    for stream in listener.incoming() {
    let handle = thread::spawn(move || {
    let stream = stream.unwrap();
    handle_connection(stream, delay);
    });
    handles.push(handle);
    // handle connection
    }
    for handle in handles {
    handle.join().unwrap();
    }
    Tokio is the idea of creating lots of non blocking simultaneous tasks that can share a much smaller thread pool.

  • @nguyenhuuanhtuan5360
    @nguyenhuuanhtuan5360 9 месяцев назад +1

    I wish my lecturers at university were like you. Thanks for the detailed explanation.

    • @chrishayuk
      @chrishayuk  9 месяцев назад

      Thank you, glad it’s useful

  • @jasonshen
    @jasonshen 2 года назад +3

    more tokio and actix tut would be awesome, as there isn't any good ones around, but yeah nice job!

    • @chrishayuk
      @chrishayuk  2 года назад +1

      i was meaning to do more on those topics. will come

    • @jasonshen
      @jasonshen 2 года назад

      @@chrishayuk nice looking forward, yeah tokio is really nice, but documentation isn't the best around to follow

  • @caseyyeow1649
    @caseyyeow1649 2 года назад +1

    Excellent video! Hi Chris. Tqvm indeed!

  • @kodedart2311
    @kodedart2311 Год назад +3

    Sooooo,
    what we gonna do now is ..., then i'm gonna do ... Then I'm gonna ..., so what I'm gonna do here is ... and the next we need gonna do is ..., so what I'm gonna do now I'm gonna ... because we gonna do ... I just gonna do... is gonna be ... coz what I'm gonna do is gonna...
    Dude. Seriously. You have great topics, skills and videos, but that narrative...
    I hit thumbs up because that's what I'm gonna do anyways.

    • @chrishayuk
      @chrishayuk  Год назад +1

      Lol, fair play. We all have development to do, to improve. Feedback is appreciated

    • @kodedart2311
      @kodedart2311 Год назад +1

      I absolutely LOVE your channel! Thank you for your amazing work.

    • @chrishayuk
      @chrishayuk  Год назад +1

      @@kodedart2311 thank you, i hope i can keep improving though

    • @lacascadaobregon
      @lacascadaobregon Год назад +1

      "Constructive criticism"

  • @nosh3019
    @nosh3019 2 года назад

    love your video. great quality. please keep releasing new ones

    • @chrishayuk
      @chrishayuk  2 года назад

      Thank you. The tokio video is a little ambitious. I always wonder if it was too complicated sometimes

  • @LongestYardstick
    @LongestYardstick Год назад

    great material sir! your video format is most excellent, always like following these longer in-depth ones for unfamiliar stuff!
    side note dude we are streaming this at 1080p, you can minimize the zoom in the vids -- you're displaying your text at like 480p and cutting off your lines is obnoxious af.

    • @jordanjohnson714
      @jordanjohnson714 5 месяцев назад

      Watching this on my phone, I do appreciate the larger font size.

  • @ChairmanHehe
    @ChairmanHehe 2 года назад +5

    :: is not turbofish.

  • @uejst
    @uejst Год назад

    Good video but there is one thing to correct, I think. At 13:37, what you describe as "connected to echo server" is not echo server and port. High port number has nothing to do with fork. It is local (client side) socket, source side of the connection. Server is always running on port 1234 and no fork can change that. You are forking executing command, but not the server itself. Client side, outgoing connections, typically have high port numbers 49k+. Pls, correct me if I'm wrong.

  • @lacascadaobregon
    @lacascadaobregon Год назад +1

    Next time, I highly recommend closing the file explorer on the left hand side of your screen while recording.
    I had difficulty reading the entire line of code on several occassions.

    • @chrishayuk
      @chrishayuk  Год назад

      Ah yeah, I try and remember to do that but often forget, apologies

  • @dragonmax2000
    @dragonmax2000 2 года назад +1

    Awesome contetn. Thank you!

  • @analisamelojete1966
    @analisamelojete1966 Год назад

    Hey nice content! I was digging into some rust projects related to RabbitMQ, but none of them have good docs. On top of being unfinished (mostly abandoned) projects. So, would it be possible for you to do a video on how to connect to rabbitMQ, create a channel, queues and subscribe consumers? Using tokio :)

  • @job4753
    @job4753 2 года назад +3

    I am very much a beginnner, so this is a bit too much for now:)
    But saved the video to come to it later.

    • @chrishayuk
      @chrishayuk  2 года назад +1

      Yeah this one is a little advanced of a use case

    • @job4753
      @job4753 2 года назад

      @@chrishayuk yep hahaha.
      Am developing a discord bot, so still ended up using tokio. Tokio is not even the most difficult thing tbh when creating a discord bot.
      Its more about poor documentation / outdated info. Discord is moving towards slash commands for bots, although prefix commands will still exist for approved bots, unfortunately there is almost no documentation for Rust on how to do this except for the Poise crate.

  • @michah3956
    @michah3956 Год назад

    @Chris Hay I'm looking to build multiple concurrent servers on different ports with Rust and Tokio (Websocket and TlsStream). How to do it?

  • @spaghettispaghetto
    @spaghettispaghetto 2 года назад +2

    Great video

  • @Asgallu
    @Asgallu 2 года назад +1

    Thanks for the video

  • @Brian-nh9dk
    @Brian-nh9dk 2 года назад

    Thanks for the great content, Chris. Starting watching this while going through the tokio tutorial in order to understand the blog post: "Combining Axum, Hyper, Tonic, and Tower for hybrid web/gRPC apps". It would be great to get your perspective on axum in a future video. Cheers.

  • @4zv4l38
    @4zv4l38 Год назад

    nice video ! may I ask the nice vscode extension you have that complete the variable type and show the named argument for function ? (also if possible the extension that underline the text with warnings)

    • @alexapps5834
      @alexapps5834 Год назад

      Hi! You maybe have had an answer since then but for the sake of answering, this is rust-analyzer. This is a must-have when writing Rust, it just makes it so nicer.

  • @0xhiro
    @0xhiro 2 года назад +1

    I love this video. Would love to see a UDP version.

  • @TheRealAfroRick
    @TheRealAfroRick 2 года назад +2

    THis is cool right up until you bring in karin. After that the application flow is a bit of a mess and it gets a lot harder to follow.

    • @chrishayuk
      @chrishayuk  2 года назад

      i agree.. i never felt i got it quite right, it got quite complicated quite quickly at that point

  • @thirdreplicator
    @thirdreplicator 2 года назад +1

    Cool accent.

    • @chrishayuk
      @chrishayuk  2 года назад

      i have no idea what my accent is anymore looool