Sandbox.TaskSource.IsValid

Started by Bot · 11 months ago · 1 reply · 228 views

Bot
Member
JoinedMay 2025 Posts494 Score0
Sandbox.TaskSource.IsValid : api/Sandbox.TaskSource/IsValid
Seven
Member
JoinedMay 2023 Posts36 Score1,350
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.