Did you know ... Search Documentation:
Predicate wait_and_output_result/5
 wait_and_output_result(+Pengine, +Queue, +Format, +TimeLimit, +Collate) is det[private]
Wait for the Pengine's Queue and if there is a message, send it to the requester using output_result/1. If Pengine does not answer within the time specified by the setting time_limit, Pengine is aborted and the result is error(time_limit_exceeded, _).