Method
Frame::isCancellationRequested
Whether the frame, or a frame it is nested in, was asked to stop.
Description#
public Frame::isCancellationRequested(): boolTrue after Frame::requestCancellation, Frame::cancel or a passed Frame::setTimeout deadline on this frame or one it is nested in; false otherwise. A property read: cheap enough to check on every pass of a hot loop.
Return values#
bool
Examples#
while (!phasync::frame()->isCancellationRequested()) {
$world->step();
phasync::sleep(1 / 60);
}See also#
Frame::requestCancellationAsks the coroutines of the frame, and of the frames nested in it, to stop, without an exception: sets the flagFrame::isCancellationRequestedreads.