Method
phasync::frame
Returns the frame of the running coroutine: that of the innermost run() it is in.
Description#
public static phasync::frame(): FrameA coroutine belongs to the frame of the run() that started it, and a nested run() gives the coroutine that calls it a new frame until it returns.
Return values#
Frame
Errors / Exceptions#
| Exception | When |
|---|---|
LogicException | Outside a coroutine, and in a service, which has no frame |
Examples#
phasync::run(function () {
phasync::frame()->setTimeout(1.0); // this run(), and every coroutine started inside it
});See also#
FrameThe lifetime of aphasync::run()call: the coroutines started inside it, which it waits for, cancels and rethrows.phasync::runRuns$fnand returns its result once it and every coroutine started inside it have ended.