Rust to Redis with Async/Await [Intermediate]

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • Gist link: gist.github.co...
    Quick code walkthrough for Rust Redis communication with Rust/Tokio async/await for Single-Threaded Concurrency!!! RustLang by Example
    At the end, we see how making the program single-threaded still allows for concurrency. #RustLang #Rocks !
    #RustRedis #Redis #RustLang #AsyncAwait #Concurrency #RustForFullStack
    Other popular Rust Programming videos:
    - Desktop Applicatin Code Rust Programming template full Overview: • Building Awesome Deskt...
    - Tauri Quick Introduction (Desktop App wit Rust Programming): • Rust Tauri 1.0 - Quick...
    - Rust Web App tutorials series: • Rust Web App - 1/3 - D...
    - Rust Bevy Full Tutorial - Game Development with Rust: • Rust Bevy Full Tutoria...
    - Rust for Java Developers series: • Rust for Java Develope...
    Playlists:
    - Rust For Desktop App: • JC - Rust Programming ...
    - Everything Rust Programming - Tutorials, Courses, Tips, Examples: • JC - Rust - Everything...
    - Rust Programming for Web Development: • JC - Rust Programming ...
    - Rust Courses: • Rust Course 2021 by th...
    - Furst for Java Developers: • Rust for Java Developers

ความคิดเห็น • 11

  • @hojjat5000
    @hojjat5000 3 ปีที่แล้ว +3

    I like that this is short, but to the point.
    Very clear example. Great job.

  • @cutevegan7163
    @cutevegan7163 3 ปีที่แล้ว +5

    nice :) Thanks. Rust lang really need examples like this not the basic hello world

  • @fortysixfish
    @fortysixfish 3 ปีที่แล้ว +1

    Thanks for sharing. I really enjoyed the format of this

  • @GlobalYoung7
    @GlobalYoung7 2 ปีที่แล้ว

    Thank you 👍

  • @MrAtomUniverse
    @MrAtomUniverse ปีที่แล้ว +1

    Would it be easier if we use Rust with SurrealDB since it's both in rust

    • @JeremyChone
      @JeremyChone  ปีที่แล้ว +2

      For some use cases you are totally right.
      However, redis can be used as a shared memory cache or queue/message bus, with its stream feature, so in those cases redis integration brings additional value.

  • @thelastninja4825
    @thelastninja4825 2 ปีที่แล้ว

    shouldnt you use on connection as a duplexer ? thats what i use in c#

    • @JeremyChone
      @JeremyChone  2 ปีที่แล้ว

      This is just a code example to show the power of rust async/await and Redis blocking call on a NIO channel.
      You would take this as a base for real apps and decide what makes sense from a client concurrency point of view.
      For example, when we use redis Stream for k8s-based worker queues, the benefits of multiplexing on the connection is not that much, as most of the work happens on the Job side. You probably want the granularity to be on the pod levels anyway to use Kubernetes auto-scaling and such and have each pod be a "single job at a time" type of worker.
      But the cool aspect with Rust efficient low level async/await is that you can design those parts as best fit your need.

    • @thelastninja4825
      @thelastninja4825 2 ปีที่แล้ว

      @@JeremyChone got it, thank you

  • @sacaelcod
    @sacaelcod 7 หลายเดือนก่อน

    Hi, pub/sub?

    • @JeremyChone
      @JeremyChone  7 หลายเดือนก่อน

      Yes, but more powerful, with workgroup and all. Redis Stream is a Gem for event based architecture.