Logtalk reference manual
Built-in predicate: threaded_peek/1

threaded_peek/1

Description

threaded_peek(Goal)

Checks if the result of proving Goal in a new thread is already available. This call succeeds or fails without blocking execution waiting for a reply to be avaialble.

Template and modes

threaded_peek(?callable)

Errors

Goal is a variable:
instantiation_error
Goal is neither a variable nor a callable term:
type_error(callable, Goal)

Examples

To check for an asynchronous goal proof result:
threaded_peek(Goal)
To check for an asynchronous message to self result:
threaded_peek(::Goal)
To check for an asynchronous message result:
threaded_peek(Object::Goal)