Skip to main content

Module util

Module util 

Source
Expand description

Small helpers which modules share that do not depend on each other otherwise.

Constantsยง

SCRATCH ๐Ÿ”’
See with_scratch.

Functionsยง

format_duration ๐Ÿ”’
A duration in whole seconds, with the minutes apart, like 10m, 1m 30s or 45s, for the errors.
sleep_until ๐Ÿ”’
Sleep until the deadline, forever without one.
with_scratch ๐Ÿ”’
Run f on a buffer of len bytes which the thread keeps for all reads which copy what they got out of it right away. The read loops of all containers and attach clients and the runtime calls share it, instead of keeping a buffer each while they wait. It grows to the largest len asked for and holds what the last use left in it.
with_stderr ๐Ÿ”’
Append the stderr of a runtime which failed to its error, unless it wrote nothing. It usually holds the reason.