Check the elapsed time since the last call to this function or to startCancelableOperation. If the predefined
period (configured with setInterruptionPeriod) is exceeded, execution is delayed with delayNextTick.
If the predefined period is not met yet or execution is resumed after an interruption, the given cancellation
token is checked, and if cancellation is requested, OperationCanceled is thrown.
All services in Langium that receive a CancellationToken may potentially call this function, so the
CancellationToken must be caught (with an async try-catch block or a catch callback attached to
the promise) to avoid that event being exposed as an error.
This function does two things:
startCancelableOperation
. If the predefined period (configured withsetInterruptionPeriod
) is exceeded, execution is delayed withdelayNextTick
.OperationCanceled
is thrown.All services in Langium that receive a
CancellationToken
may potentially call this function, so theCancellationToken
must be caught (with anasync
try-catch block or acatch
callback attached to the promise) to avoid that event being exposed as an error.