-
Notifications
You must be signed in to change notification settings - Fork 0
scriptDone
ffredyk edited this page Jul 23, 2026
·
1 revision
Concurrency
Unary — scriptDone <scriptHandle>.
scriptDone <scriptHandle>
Returns true if the ScriptHandle has been resolved (the spawned code finished or was terminated). Returns false if the code is still running. Does not suspend — this is a non-blocking status check.
Equivalent to isNull _handle.
Checks the internal IsResolved flag on the handle. O(1) query. No side effects.
_handle = spawn { sleep 5; doWork(); };
// Later, check without suspending:
if (scriptDone _handle) then {
systemChat "Task complete";
} else {
systemChat "Still working...";
};while { !scriptDone _handle } do {
// do other work while waiting
sleep 0.1;
};_allDone = true;
{ if (!scriptDone _x) then { _allDone = false } } forEach _handles;
if (_allDone) then {
systemChat "All tasks complete";
};if (scriptDone _handle) then {
_result = await _handle; // returns immediately since already done
};// scriptDone: check without waiting
_done = scriptDone _handle;
// await: wait until done, get result
_result = await _handle;ReadOnly — pure query. Safe from any scheduler.
- Getting Started
- Language Guide
- Type System
- Control Flow
- Functions & Code
- Strings & Text
- Arrays & Collections
- Concurrency
- Promise System
- Thread Safety
- Host API & Embedding
- CLI Tool
- Bytecode Reference
- Multiplayer
- Syntax Sugar
- Optimization Guide
- Benchmarks
- count
- select
- pushBack
- append
- deleteAt
- deleteRange
- resize
- reverse
- sort
- find
- in
- forEach
- freeze
- thaw
- isFrozen
- currentScheduler
- clientOwner
- allSchedulers
- schedulerName
- schedulerExists
- schedulerBudget
- setSchedulerBudget
- fiberCount
- readyFiberCount
- waitingFiberCount
- schedulerLoad
- sendTo