管道
⚠️ Salsa 仍在进展中 ⚠️
本页描述了未发布的 Salsa 2022 版本,该版本与旧版本大不相同。此处的代码有效,但仅在 github 和
salsa-2022
crate 中可用。
本章记录了 Salsa 生成的代码及其“内部工作原理”,这被称为“管道” (plumbing)。
概述
管道分为以下几章:
- The jars and ingredients covers how each salsa item (like a tracked function) specifies what data it needs and runtime, and how links between items work.
- The database and runtime covers the data structures that are used at runtime to coordinate workers, trigger cancellation, track which functions are active and what dependencies they have accrued, and so forth.
- The query operations chapter describes how the major operations on function ingredients work. This text was written for an older version of salsa but the logic is the same:
- The maybe changed after operation determines when a memoized value for a tracked function is out of date.
- The fetch operation computes the most recent value.
- The derived queries flowchart depicts the logic in flowchart form.
- The cycle handling handling chapter describes what happens when cycles occur.
- The terminology section describes various words that appear throughout.