memo
memo
#
What the store has for one call key: its sealed results, a claim to compute it, or nothing.
Scratch.memo(key) is the one question a memoized call asks, answered in that
order:
- Results — a hold on every sealed result, in return order. A ragged set, one result of two evicted, is no result at all.
- Computing — nobody has sealed it, but some living thread or process holds the key's call lock: the body is running right now.
- Nothing — neither: nobody has computed this key and nobody is.
Memo
dataclass
#
What the store has for one call key; see the module for the three answers.
Attributes:
| Name | Type | Description |
|---|---|---|
results |
tuple[Pinned, ...]
|
A hold on each sealed result, in return order; empty unless every one of them is present. |
computing |
bool
|
Whether the key's call lock is held, so its body is running
somewhere; |
Source code in capturegraph-lib/capturegraph/scratch/store/memo.py
call_memo(scratch, key, count)
#
What scratch has for key, whose call returns count results.