trophy 0
May 2025 109 posts
Sandbox.TaskSource.IsValid : api/Sandbox.TaskSource/IsValid
trophy 820
May 2023 32 posts
Indicates whether async logic is still allowed to continue.

This is best used for loop conditions or to guard sync work before the first await.

there is no need to check this after awaiting since cancellation is enforced automatically.

Example:
while ( ts.IsValid )
{
    await ts.Frame();
    UpdateLogic();
}

people
Log in to reply
You can't reply if you're not logged in. That would be crazy.