Process <: AbstractEvent
Process is an abstraction for an event yielding function, a process function.
The process function can suspend its execution by yielding an
Process will take care of resuming the process function with the value of that event once it has happened. The exception of failed events is also thrown into the process function.
Process itself is an event, too. It is triggered, once the process functions returns or raises an exception. The value of the process is the return value of the process function or the exception, respectively.
Process(env::AbstractEnvironment, func::Function, args...) → Process¶
Process(env::AbstractEnvironment, name::ASCIIString, func::Function, args...) → Process
Process. The argument
func is the process function and has the following signature :func:
func(env::AbstractEnvironment, args...) <func>. If the
name argument is missing, the name of the process is a combination of the name of the process function and the event id of the process. An
Initialize event is scheduled immediately to start the process function.
DelayedProcess(env::AbstractEnvironment, delay::Float64, func::Function, args...) → Process¶
yield(ev::AbstractEvent) → Any¶
Passes the control flow back to the simulation. If the yielded event is triggered , the simulation will resume the function after this statement. The return value is the value from the yielded event.
is_process_done(proc::Process) → Bool¶
true if the process function returned or an exception was thrown.
Initialize <: AbstractEvent
Start a process function. Only used internally by
This event is automatically triggered when it is created.
Interrupt <: AbstractEvent
Interrupt(proc::Process, cause::Any=nothing) → Interruption¶
Immediately schedules an
Interruption event with as value an instance of
InterruptException. The process function of
proc is added to its callbacks. An
Interrupt event is returned. This event is automatically triggered when it is created.