-
Notifications
You must be signed in to change notification settings - Fork 0
isNull
ffredyk edited this page Jul 23, 2026
·
1 revision
Type / Introspection
Unary — isNull <value>.
isNull <any>
Checks whether a value is "null":
-
ScriptHandle: returns
trueif the handle has been resolved (the spawned code has finished or been terminated). -
Nil: returns
true(nil is null). -
Other values: returns
false.
This is the standard way to check if an async operation has completed.
- ScriptHandle: checks the internal
IsResolvedflag. Returnstrueif the handle is done. - Nil: returns
true. - Everything else:
false.
_handle = spawn { sleep 5; doWork(); };
// ... later ...
if (isNull _handle) then {
systemChat "Work completed";
};_handle = spawn { longOperation(); };
while { !isNull _handle } do {
sleep 0.1;
};
systemChat "Done!";_handle = spawn { sleep 5; return 42; };
_result = await _handle; // cleaner than polling isNullif (isNull _handle) then {
_result = get _handle; // safe to get result
};isNil nil; // true
isNull nil; // true
_handle = spawn { sleep 1; };
isNil _handle; // false — handle exists
isNull _handle; // false — handle not resolved yetReadOnly — pure query. Safe from any scheduler.
- isNil — nil/undefined check
- scriptDone — alias, same behavior
- await — wait for handle to resolve
- terminate — force-resolve handle
- spawn — create async handle
- 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