The channel objects here are provided so that tasks can
communicate with each other. They provide blocking queues with a
maximum size of one. The blocking is done inside in that the
current tasks yields, and then gets suspended and resumes if the
desired conditions are met. Or if an exception gets processed due
to an abort.
Unlike timers which are assumed to perform short lived actions, tasks are offered to perform longer living actions. The Prolog systems maintains a list of the alive tasks, that can be queried with the predicate current_task/1. Tasks that are expected about to die, can be awaited with the predicate task_join/1 by multiple waiters.
The following tasks predicates are provided: