Skill map · rust-async

Async Rust

GoalBuild a small Tokio HTTP service at workbuild mode

2 of 20 mastered1 in progress

  • Mastered 2
  • In progress 1
  • Ready 2
  • Locked 15

Up nextReview first: Running futures concurrently with join!, then Running futures concurrently with join! · Spawning tasks and the 'static bound · The Future trait and polling

Stage 1
MasteredWhy async: concurrency, parallelism and threadsWhat problem async solves (many tasks waiting on I/O), how concurrency differs from parallelism, and when plain threads are the better tool.
Stage 2
Stage 3
In progressRunning futures concurrently with join!Overlapping several futures inside one task with join! and try_join!, and why sequential .awaits do not overlap.
ReadyThe Future trait and pollingWhat Future::poll returns, who calls it, and the contract a future and its caller must follow.
ReadySpawning tasks and the 'static boundTasks versus futures, tokio::spawn and JoinHandle, async move captures, and why spawned futures must be 'static.
Stage 4
LockedChannels and the actor patternMessage passing between tasks with mpsc and oneshot channels, backpressure from bounded channels, and owning state in an actor task behind a handle.Needs Spawning tasks and the 'static bound
LockedWakers, executors and the reactorHow Context and Waker let an executor re-poll only woken tasks, what a minimal executor does, and how the I/O reactor ties leaf futures to a runtime.Needs The Future trait and polling
LockedBlocking the executor, yielding and spawn_blockingWhy scheduling is cooperative, how blocking calls and long CPU loops starve other tasks, and how to yield or offload work with spawn_blocking or rayon.Needs Spawning tasks and the 'static bound, The Future trait and polling
LockedAsync functions as state machinesHow the compiler turns an async fn into an enum-like state machine whose states are the .await points, and what gets stored across each await.Needs The Future trait and polling
Stage 5
LockedBridging sync and async codeCalling async code from synchronous code with a Runtime or Handle, calling sync code from async code, and why block_on inside a runtime panics.Needs Blocking the executor, yielding and spawn_blocking, Wakers, executors and the reactor
LockedCancellation is dropping a futureHow dropping a future cancels it at its current .await point, what still runs (destructors) and what never does, and why there is no async Drop.Needs Async functions as state machines
LockedSend futures and values held across .awaitWhy a future is Send only if everything alive at each .await is Send, and how to fix 'future cannot be sent between threads safely'.Needs Spawning tasks and the 'static bound, Async functions as state machines
LockedPin and UnpinWhy self-referential async state machines must not move, what Pin guarantees, what Unpin opts out of, and how to pin with pin! or Box::pin.Needs Async functions as state machines
Stage 6
LockedShared state: std Mutex vs tokio MutexWhen the standard Mutex is the right choice in async code, when the guard must live across an .await, and how holding a lock across await can deadlock.Needs Send futures and values held across .await, Blocking the executor, yielding and spawn_blocking
Lockedasync fn in traits and async closuresStable async fn in traits (Rust 1.75) and its dyn and Send limits, and true async closures with the AsyncFn traits (Rust 1.85).Needs Send futures and values held across .await
LockedBoxed futures and async recursionWhy a recursive async fn has infinite size, and how Pin<Box<dyn Future>> (BoxFuture) gives indirection for recursion and type erasure.Needs Pin and Unpin
LockedRacing futures with select! and timeoutsUsing tokio::select! and timeout to race futures, and what happens to the branches that lose.Needs Running futures concurrently with join!, Cancellation is dropping a future
LockedTask handles: detaching, aborting and JoinSetWhat happens when a JoinHandle is dropped, how to abort tasks or signal them with a CancellationToken, and how JoinSet gives structured task lifetimes.Needs Spawning tasks and the 'static bound, Cancellation is dropping a future
LockedStreams: async iterationThe Stream trait as an async iterator, consuming streams with next().await, and combining and adapting them with StreamExt.Needs Pin and Unpin
Stage 7
LockedCancellation safety in select! loopsWhich operations lose data when cancelled, how to keep one pinned future alive across loop iterations, and why cancel safety is not cancel correctness.Needs Racing futures with select! and timeouts, Pin and Unpin

Made with byagent

Published with byagent