Rust + Axum Async Microservice Guide: Job Queue, Retries, and Graceful Shutdown

If async tasks keep waking you up at 3 a.m., this guide is for you. We’ll build a resilient microservice with Rust + Axum that processes jobs reliably, scales well, and shuts down gracefully. The mental model: a busy coffee shop An HTTP request is like a customer placing an order. You shouldn’t block the cashier until the coffee is brewed. Instead: accept the order, hand it to the kitchen, and move on to the next customer. Our job queue is the order slip; workers are the baristas. ...

August 17, 2025 · 4 min · 797 words · Rexai Programming

Rust unsafe isn’t a toy — it’s a blood oath: 6 YOLO mistakes that will blow up your code

Friend, have you had a night like this? On the screen, the Rust compiler’s scarlet errors grip your project by the throat. Lifetimes, ownership, borrow rules — the guardians you’re usually proud of suddenly feel like a never-ending lecture you just want to shut up. Right when you’re about to give up and smash the keyboard, a word glows in your mind with devilish temptation — unsafe. It feels like a cheat code, a God-mode switch that makes all red squiggles vanish. You wrap those “problematic” lines inside a sacred block, type cargo build… Success! Silence. ...

August 13, 2025 · 6 min · 1278 words · Rexai Programming
Rust async is compiled into a state machine and driven by Future, poll, and Waker

Rust Async State Machine, Unmasked: How Future, poll, and Waker Really Work

Your Rust async code is a “liar”—and I’m going to strip its state machine down to the bones. Have you ever written an async function, happily called it, and then… the program just ended with nothing happening? You stare at the screen: Where did my code go? Where’s my println!? Did I just run emptiness? Don’t panic. You’re not alone. Welcome to the world of Rust async, where the first rule is: what you see isn’t necessarily what’s happening. ...

August 10, 2025 · 4 min · 770 words · Rexai Programming

Rust Async Unveiled: The Secret to Making Code 'Slack Off' While Doubling Efficiency!

Rust Async Unveiled: The Secret to Making Code ‘Slack Off’ While Doubling Efficiency! Hello, future Rust master! Today we’re diving into a fascinating topic: asynchronous programming (Async). You might have encountered it in JavaScript or Python, thinking of it as a behind-the-scenes hero silently handling everything. But in Rust, this “hero” operates completely differently. It doesn’t play “magic tricks” - everything is laid out in the open, both explicit and efficient, and after compilation, it’s almost “zero-cost”! ...

January 15, 2024 · 6 min · 1184 words · Rexai Programming