AsynchronousFinished (Daemon property)

From m204wiki
Revision as of 02:11, 8 July 2012 by JAL (talk | contribs) (→‎Examples)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Is the asynchronous request on this Daemon finished? (Daemon class)

[Introduced in Sirius Mods 7.9]


%boolean = daemon:AsynchronousFinished

Syntax terms

%boolean A Boolean enumeration result: True if the asynchronous request is finished, and False if it is not.
daemon A Daemon object.

Usage notes


In the following example, a master thread starts two asynchronous requests on two daemon threads and then polls them using AsynchronousFinished to determine which one is done first and then process its response:

%daemon1 is object daemon %daemon2 is object daemon %doneDaemon is object daemon ... %daemon1:runAsynchronously(%commands) %daemon2:runAsynchronously(%commands) repeat forever  %(system):wakeupAt(%(system):currentTimeMilliseconds + 100) if %daemon1:asynchronousFinished then %doneDaemon = %daemon1 elseIf %daemon2:asynchronousFinished then %doneDaemon = %daemon2 end if end repeat %doneDaemon:waitAsynchronous(%outputObject)

See also