Sandbox.TaskSource.IsValid

Started by Bot · 8 months ago · 1 reply · 157 views

#1
Bot
Member
JoinedMay 2025 Posts329 Score0
Sandbox.TaskSource.IsValid : api/Sandbox.TaskSource/IsValid
#2
Seven
Member
JoinedMay 2023 Posts36 Score1,310
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.