~/talk

CTX is Key!

Talkat GopherCon Europe 2021 · 2021-05-26..05-28· [software-architecture, go]
links:none on file
slides:none on file

Context.Context represents three fields: cancellation boolean, deadline/timeout and opaque key values, and it actually propagates cancellation and timeouts across RPCs so a root 30 second timeout cancels all downstream calls while a front end can set a 5 second subtimeout for its children. API calls are WithCancel WithDeadline WithTimeout WithValue plus Background/TODO which return never canceling empty parents. Best practices shown: always defer cancel, shorten subdeadlines to reserve time, use typed package keys for creds, and use errgroup/select on ctx.Done to stop work early.

AI-written summary · about

  1. 0:00Intro
  2. 1:05context is a common package
  3. 5:03Timeouts
  4. 8:17Hmm values seem pretty flexible...
  5. 10:52Naturally, contexts form a tree
  6. 13:00What is the API of a Context object
  7. 14:27Inside Context's implementation
  8. 16:35This forces that "tree" behavior
  9. 20:01context go code
  10. 21:31Create cancel
  11. 22:18Deadline - shortening
  12. 24:14Values - authorization lookup toy example
  13. 25:18Common Packages
~/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.