jobs
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| Job datacook.app.jobs A live job of a slot: an engine request or a view-pool future. |
||
| JobRunner datacook.app.jobs |
🛈 DocStrings¶
JobRunner: background work per view slot (Qt-free).
- Executors. The compute pool is the session's executor (
Session(executor=...)):request/request_evaluaterun there. A separate view pool runs cheap view work (column statistics, prefetch), so a slow op never blocks scrolling or profiling. - Slots. At most one live job per slot name ("current", "preview", "profile", "reader-preview", ...). Starting a job in a slot cancels the previous one (engine requests: cooperative cancellation between steps; a running op finishes and its result is dropped).
- Delivery. Done callbacks fire on a worker thread; the runner only forwards them through
post(the bridge queue), soon_doneruns on the GUI thread, after the engine events of the same computation.on_doneis called only for the slot's live job, not cancelled and (for engine requests) not stale: superseded, cancelled and stale results are dropped here. - Threading. Every method except the internal done hook is for the GUI thread only; the runner's own state is never touched from a worker.
Job
dataclass
¶
A live job of a slot: an engine request or a view-pool future.
Source code in src/datacook/app/jobs.py
node_ids
class-attribute
instance-attribute
¶
Nodes this job computes (for "computing" badges).
JobRunner
¶
Source code in src/datacook/app/jobs.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
add_listener
¶
request
¶
request(slot: str, node_id: str, on_done: Callable[[RequestLike], Any]) -> Job
Materialise node_id for slot (cancels the slot's previous job).
Source code in src/datacook/app/jobs.py
request_evaluate
¶
request_evaluate(
slot: str,
record: OpRecord,
parents: Sequence[Node | str],
on_done: Callable[[RequestLike], Any],
*,
head: int | None = None,
) -> Job
Preview a candidate op on committed parents for slot.
Source code in src/datacook/app/jobs.py
running_ids
¶
Nodes some live engine request computes (inputs, for previews).
submit_view
¶
submit_view(
slot: str, fn: Callable[..., Any], *args: Any, on_done: Callable[[Future[Any]], Any]
) -> Job
Run fn(*args) on the view pool for slot; on_done(future) on the GUI thread.