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
I like that this is short, but to the point.
Very clear example. Great job.
nice :) Thanks. Rust lang really need examples like this not the basic hello world
Thanks for sharing. I really enjoyed the format of this
Thank you 👍
Would it be easier if we use Rust with SurrealDB since it's both in rust
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.
shouldnt you use on connection as a duplexer ? thats what i use in c#
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.
@@JeremyChone got it, thank you
Hi, pub/sub?
Yes, but more powerful, with workgroup and all. Redis Stream is a Gem for event based architecture.