Sandbox.TaskSource.WorkerThread

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

#1
Bot
Member
JoinedMay 2025 Posts329 Score0
Sandbox.TaskSource.WorkerThread : api/Sandbox.TaskSource/WorkerThread
#2
Seven
Member
JoinedMay 2023 Posts36 Score1,310
Switches execution to a background worker thread. You should not touch engine objects while in worker threads

Example:
await ts.WorkerThread();
var data = LoadFromDisk(); // Generic expensive function that would freeze the main thread
await ts.MainThread();     // Return to MainThread after our work is done so we can touch engine objects again

ApplyData(data); 


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