Process
A process defines a supervised task.
Tipically a process listens for shutdown request and terminates following its workflow logic.
A process may decide to ignore a shutdown request: in this case the supervisor may force the termination of the task with a Visor.ProcessInterrupt exception after a user defined amount of time.
If a process returns or fails with an exception the supervisor applies a defined restart policy.
The full signatures of process methods are:
process(fn::Function;
args::Tuple=(),
namedargs::NamedTuple=(;),
force_interrupt_after::Real=1.0,
stop_waiting_after::Real=Inf,
debounce_time::Real=NaN,
trace_exception::Bool=false,
thread::Bool=false,
restart::Symbol=:transient)
process(name::String,
fn::Function;
args::Tuple=(),
namedargs::NamedTuple=(;),
force_interrupt_after::Real=1.0,
stop_waiting_after::Real=Inf,
debounce_time::Real=NaN,
trace_exception::Bool=false,
thread::Bool=false,
restart::Symbol=:transient)Where:
name: a user defined process name. Used for getting process withfrom_pathapi. Whennameargument is missing the process name default tostring(fn);fn: the process function;args: aTupleof function arguments;namedargs: aNamedTupleof named function arguments;force_interrupt_after: the amount of time in seconds after which if a process does not terminate by itself it is forcibly interrupted.stop_waiting_after: the amount of time in seconds after which the supervisor stop waiting for the task if a task does not terminate because it "adsorbs" theVisor.ProcessExceptionexception.debounce_time: wait time in seconds before restarting a process. Default to NaN (restart immediately);trace_exception: boolean flag for printing the error stacktrace when process exits by an exception.thread: boolean flag for threaded versus asynchronous task;restart: one of the symbols::permanentthe function is always restarted;:transientrestarted in case of exit caused by an exception;:temporarynever restarted;