memo
memo
#
What the store has for one call key: its sealed results, the steps computing 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.
- Running — the tree of steps beneath the key's own call: the calls,
maps and
cg.stepblocks in flight, how deep each sits, how long it has run, how far along it is, and the tail of its log. - Nothing — both empty: nobody has computed this key and nobody is.
A key with results reports nothing running: the results are what the caller came for, and the row of a call that has just sealed is on its way out.
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. |
running |
tuple[RunningStep, ...]
|
The steps in flight beneath the key's call, parents before
children and oldest first; empty whenever |
Source code in capturegraph-lib/capturegraph/recipes/scratch/store/memo.py
RunningStep
dataclass
#
One in-flight step beneath the key asked about.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The step's identifier. |
parent |
str | None
|
The step it sits beneath, if any. |
label |
str
|
What the step is doing, |
identity |
str | None
|
The function identity, when the step is a memoized call. |
key |
str | None
|
The call key as 64 hex characters, when the step is a memoized call. |
depth |
int
|
|
elapsed |
float
|
Seconds since the step opened. |
done |
int
|
How many units are done. |
total |
int | None
|
How many there are, if known. |
note |
str | None
|
The step's last message, if any. |
fields |
dict[str, JSONValue]
|
The named values its notes carried. |
log_tail |
str | None
|
The last lines of a call's log, if a tool wrote any. |
Source code in capturegraph-lib/capturegraph/recipes/scratch/store/memo.py
call_memo(scratch, key, count)
#
What scratch has for key, whose call returns count results.