[ library(timeout) | Reference Manual | Alphabetic Index ]


Execute Goal, deferring the execution of an interrupting timeout predicate TimeOutGoal until Goal completes.
Goal to execute


Metacall Goal, ensuring that its execution is not interrupted and preemptively aborted by a timeout of the timeout/3 or timeout/7 predicate. If a timeout would have occurred during the execution of Goal, it is effectively deferred until Goal completes.

The predicate can be used within a computation which is subject to timeouts, to ensure that subgoals which should be executed as an atomic sequence preserve this atomicity at the cost of delaying the execution of TimeOutGoal.

In all other respects the semantics of call_timeout_safe/1 is the same as call/1.


This predicate is sensitive to its module context (tool predicate, see @/2).


If Goal is resatisfiable.


    ?- timeout(call_timeout_safe((writeln('Goal started'), 
                               writeln('Goal completed'))),
            3, writeln('Timeout expired!')).
    Goal started
    Goal completed
    Timeout expired!
    Yes (0.01s cpu)

See Also

timeout / 3, timeout / 7