aivika-5.7: A multi-method simulation library

Description

Tested with: GHC 8.0.1

The Task value represents a process that was already started in background. We can check the completion of the task, receive notifications about changing its state and even suspend an outer process awaiting the final result of the task. It complements the Process monad as it allows immediately continuing the main computation without suspension.

Synopsis

Represents the result of the task.

Constructors

Return an identifier for the process that was launched in background for this task.

Try to get the task result immediately without suspension.

Return the task result suspending the outer process if required.

Return a signal that notifies about receiving the result of the task.

Return an outer process that behaves like the task itself, for example, when the task is cancelled if the outer process is cancelled.

Test whether the task was cancelled.

Run the process in background and return the corresponding task immediately.

Run the process with the specified identifier in background and return the corresponding task immediately.

Run a child process in background and return immediately the corresponding task.

Run using the specified identifier a child process in background and return immediately the corresponding task.

Run a child process in background and return immediately the corresponding task.

Run using the specified identifier a child process in background and return immediately the corresponding task.

enqueueTask :: Double -> Process a -> Event (Task a) Source #

Enqueue the process that will be started at the specified time from the event queue. It returns the corresponding task immediately.

Enqueue the process that will be started at the specified time with the given identifier from the event queue. It returns the corresponding task immediately.