~/talk

Keynote | Actors with Tokio – a lesson in ownership

Talkat RustLab 2022 · 2022-10-02..10-04· [concurrency, rust]
slides:none on file

Shows an actor pattern using Tokio: a background task owns a TCP stream and a separate handle with cloned mpsc sender for shared access sends enum messages that include a oneshot per-message response so replies match requests. run() is tokio::spawn of a future that owns the actor; avoid lifetimes on message types to keep the future 'static. Covers timers and tokio::select, warns to use std::thread::spawn (not spawn_blocking) for blocking IO, and explains backpressure options: await on bounded send, try_send, drop/load-shed, or unbounded growth.

AI-written summary · about

  1. 0:00Keynote introduction
  2. 1:38Actors and ownership in Rust
  3. 2:47Actors for IO resources
  4. 4:17Actor message passing example
  5. 8:13Ownership in actors
  6. 12:36Lifetime annotations and their pitfalls
  7. 21:25Actor implementation flexibility
  8. 25:49Minimal Tokio actor
  9. 26:54Actor design tips
  10. 30:08Back pressure handling
  11. 35:49Dynamic dispatch
  12. 38:04Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.