Expand description
Running the commands an Engine spells out.
Two ways of running, because QCode asks two kinds of question. Most commands answer at once
and their answer is read whole (capture). Building an image does not: it talks for
minutes, the person watches it in a log and may change their mind, so stream hands over
every line as it arrives and stops when asked (build_image then clears the half-made
image away).
Neither of them is a place to wait: the caller runs them inside a qframe Task, whose
thread they already have, whose is_cancelled is the cancel they are given and whose
send carries the lines to the log.
Structs§
- Failure
- A command that ran and failed. It carries what was run and everything the engine said, so the person can be shown the engine’s own words rather than a summary of them.
Enums§
- Engine
Error - Why a command did not do what was asked.
Functions§
- build_
image - Builds an image, showing the build as it happens and leaving nothing behind when it is cancelled or fails.
- capture
- Runs
commandto the end and returns what it printed to standard output. - feed
- Runs
command, writesinputto its standard input and closes it, and returns what it printed to standard output, the waycapturedoes, deadline and all. - pipe
- Runs
fromandtoside by side with whatfromprints going straight intoto, the way a shell’s|does: the bytes pass from one process to the other and never through QCode, so a home of any size is copied in the memory of a pipe. - speak_
with - Gives the engine layer the person’s translator for the sentence of
timed_out, which is mostly made on a background thread: the runtime lends its translator only to the screen’s own work.wordsis asked each time, so a language changed since the start is the one used. Without it the sentence is English. - stream
- Runs
command, handing every line tolineas it arrives, and stops it as soon ascancelsays so. - timed_
out - The sentence the person reads when an engine did not answer in time: which engine, how long it was given, and what is most likely wrong, in their language.