TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Write a mini-Redis in Rust: learn async programming with Tokio

63 点作者 VitalyAnkh将近 5 年前

4 条评论

sanxiyn将近 5 年前
This is a fine tutorial, but I must note that Rust async programming is a bad way to learn about Rust, and also is a bad way to learn about async programming. You should learn the basics of both Ruts and async programming elsewhere, and then try Rust async programming.<p>If you disagree, take a look at compile error in <a href="https:&#x2F;&#x2F;tokio.rs&#x2F;tokio&#x2F;tutorial&#x2F;streams" rel="nofollow">https:&#x2F;&#x2F;tokio.rs&#x2F;tokio&#x2F;tutorial&#x2F;streams</a> and think again. That is in fact NOT atypical. (Amusing paradox: you get less errors once you learned, but you get the most terrible errors when you are the least equipped to deal with them.)<p>To slightly exaggerate, I spend about half my time in Rust support chat channel in my locality to discourage people from trying Rust async programming without getting the basics of Rust. Their logic go: I am interested in Rust only for async network programming, I am not interested in Rust sync network programming, I also learn best by try using something in a project straight away, so I will just learn Rust by writing a Rust async programming project! This literally 100% fails, but people who do this really really want to do it that way, and discouragement doesn&#x27;t really work, and they get really frustrated, and... I am not sure how to solve this.
评论 #24057395 未加载
评论 #24057742 未加载
评论 #24056487 未加载
评论 #24055757 未加载
评论 #24055900 未加载
Fiahil将近 5 年前
Hold on, there is way more documentation than before ! Things like “when to use std::sync::mutex vs tokio::sync::mutex” were not there 1 version ago ! additionally, framing and streams will be of great help for my current project!
kanobo将近 5 年前
Redis is one of those things that deceptively looks like it would be easy to build in the eyes of a beginner engineer but in reality is a great technical achievement.
评论 #24056004 未加载
rcarmo将近 5 年前
This is pretty neat. I’ve always thought Redis was a good way (and arguably a better one) to get to grips with network code in a new language&#x2F;runtime.<p>I did it for asyncio, Go, Clojure and a few other things.