Interface ProcessControl
@NonExtendable
public interface ProcessControl
The machine's process slot (ARCHITECTURE.md ยง13, D15). Every operation is one transaction:
resources are never lost. Owner thread only.
-
Method Summary
Modifier and TypeMethodDescription@NotNull ProcessStatusadvance()Advances by the ticks elapsed since the machine last ticked: pays costs, makes progress, and delivers outputs when done.@NotNull ProcessStatusadvance(long ticks) Likeadvance(), but by exactlyticksticks (at most what remains).@NotNull ProcessStatuscancel()Cancels the process and returns its in-flight inputs to the input storages.@Nullable ProcessViewcurrent()@NotNull Result<ProcessView> start(@NotNull ProcessingRecipe recipe, @NotNull ProcessBinding binding) Consumes the recipe's inputs into the in-flight buffer and starts the process.
-
Method Details
-
current
-
start
@NotNull @NotNull Result<ProcessView> start(@NotNull @NotNull ProcessingRecipe recipe, @NotNull @NotNull ProcessBinding binding) Consumes the recipe's inputs into the in-flight buffer and starts the process.- Returns:
- the new process, or an error (e.g. insufficient input, a process already running)
-
advance
Advances by the ticks elapsed since the machine last ticked: pays costs, makes progress, and delivers outputs when done. Retries delivering outputs or returning inputs if pending. -
advance
Likeadvance(), but by exactlyticksticks (at most what remains). -
cancel
Cancels the process and returns its in-flight inputs to the input storages.
-