
Bounded Channels and Backpressure in Tokio Done Explained
A bounded channel makes a fast producer wait for a slow consumer. See capacity, send().await, try_send, and how to choose a size that does not hide overload.
Everything you need to level up your coding skills.

A bounded channel makes a fast producer wait for a slow consumer. See capacity, send().await, try_send, and how to choose a size that does not hide overload.

Files in the tests directory are separate crates that use your library like any outside user. Learn the layout, shared helpers without duplicate test binaries and testing a binary crate.

Shut down a Tokio service cleanly: catch SIGTERM and Ctrl+C, stop accepting work, wait for in flight tasks with TaskTracker, then exit within a deadline.

Cache the Cargo registry and target directory in CI with Swatinem/rust-cache. Learn what is cached, the cache key, why caches go stale and how to keep restore times low.

Stop a Tokio task three ways: JoinHandle::abort, a CancellationToken for cooperative shutdown, and dropping a future. See what each does to cleanup.

cargo build is slow to run and fast to compile, cargo build --release is the reverse. See what each profile changes, how to measure the gap and how to tune the dev profile.

select! races futures and drops the losers, which is only safe if they can be dropped mid way. Learn what cancellation safe means and which APIs are not.

Set up rust-analyzer in VS Code, Neovim, Helix or Zed, and tune the settings that matter: check on save with Clippy, proc macro support, workspace loading and memory.

Both move blocking work off the async threads, but they differ in pool, limits and fit. See which to pick for file I/O, hashing and number crunching.

Use types to encode domain rules: value objects with validating constructors, enums for states, aggregates that guard invariants and domain errors. Skip the parts that need a framework.

JoinSet owns a group of spawned tasks and returns their results as they finish. See spawn, join_next, abort_all and how errors and panics surface.

Build SQLx code without a database by saving query metadata in .sqlx with cargo sqlx prepare. Includes the CI check that keeps it fresh and the errors when it is stale.
We send one email when a new post is published. No spam.