Commit 14f8129
cluster: add internal worker_output_hook for customizing worker output
Add an internal, unstable `worker_output_hook` Ref that, when set, transforms
each line of a worker's output into the string that should be printed for it.
`Distributed` still owns the actual printing, so a hook may return a
`StyledStrings`-styled line and it will render correctly on IOs that do or do
not support color. When the hook is unset (the default) the standard prefix is
used. A hook that throws falls back to the default prefix so worker output is
never swallowed.
The default prefix indent is also reduced from six spaces to a single space.
The hook is deliberately not exported and carries no compatibility guarantees;
it exists so test harnesses can label worker output with richer context (e.g.
which test a worker is running).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent da43f39 commit 14f8129
1 file changed
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
297 | 324 | | |
298 | 325 | | |
299 | 326 | | |
300 | | - | |
| 327 | + | |
301 | 328 | | |
302 | 329 | | |
303 | 330 | | |
304 | 331 | | |
305 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
306 | 346 | | |
307 | 347 | | |
308 | 348 | | |
| |||
0 commit comments