Type/to search
Built-in Functions
Global
Version
IsVirtual
GetOS
GetPid
GetMeta
Sleep
Unix
UnixNano
_D
GetCommand
GetLastError
SetErrorFilter
_N
_C
_Cross
JSON.parse
JSON.stringify
Encode
MD5
UUID
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
Web3
Uniswap
TA
Talib
OverlapStudies
MomentumIndicators
VolumeIndicators
VolatilityIndicators
CycleIndicators
PriceTransform
StatisticFunctions
MathTransform
MathOperators
PatternRecognition
OS
Structures
Built-in Variables

Event object for event notification and signal passing between multiple threads.

The set() function is used to set an event signal.

set()

Examples

Please refer to the examples in the threading.Event() section.

See Also

Remarks

If the event has already been set via set(), it cannot be set again. You need to call the clear operation first before resetting the signal.

The clear() function is used to clear the signal.

clear()

Examples

Please refer to the example in the threading.Event() section.

See Also

The wait() function is used to set event (signal) waiting, which will block until the event (signal) is set; supports setting timeout parameters.

wait()
wait(timeout)

Examples

Test the return value of the wait() function.

javascript
function main() { var event = threading.Event() var t1 = threading.Thread(function(event) { var ret = event.wait(100) Log(`event.wait(100):`, ret) ret = event.wait() Log(`event.wait():`, ret) }, event) Sleep(1000) event.set() t1.join() }

Returns

TypeDescription

bool

The wait() function returns whether a timeout occurred, returning true if a timeout occurs.

Arguments

NameTypeRequiredDescription

timeout

number

No

The parameter timeout is used to set the waiting timeout period, in milliseconds.

See Also

The isSet() function is used to determine whether an event (signal) has been set.

isSet()

Examples

Please refer to the examples in the threading.Event() section.

Returns

TypeDescription

bool

The isSet() function returns the set status of the event (signal); returns true if the event (signal) has been set.

See Also