ContinueAsynchronously (Daemon subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 26: Line 26:
<ul>
<ul>
<li>The <var>[[Continue (Daemon function)|Continue]]</var> and <var>[[ContinueIndependently (Daemon subroutine)|ContinueIndependently]]</var> methods also tell a daemon to continue from a <var>ReturnToMaster</var> wait.</li>
<li>The <var>[[Continue (Daemon function)|Continue]]</var> and <var>[[ContinueIndependently (Daemon subroutine)|ContinueIndependently]]</var> methods also tell a daemon to continue from a <var>ReturnToMaster</var> wait.</li>
<li>Once started via <var>ContinueAsynchronously</var>, the <var class="term">daemon</var> thread is considered to be running asynchronously until a <var>[[WaitAsynchronous (Daemon function)|WaitAsynchronous]]</var> is issued against the <var class="term">daemon</var> object. This is the case, even if the <var class="term">daemon</var> thread has completed processing all of the input commands.
<li>While the <var class="term">daemon</var> thread is running asynchronously, any methods that require interaction with it cause request cancellation.
<li><var>WaitAsynchronous</var> is used to retrieve any output from the commands run via <var>ContinueAsynchronously</var>. This includes the terminal output and any output or info object.
<li>As described in: [[Daemon class#Working with Daemon objects|"Working with Daemon objects"]], the <var>ContinueAsynchronously</var> <var class="term">commands</var> argument can pass multiple commands to the <var class="term">daemon</var> object.
<li>For more information about asynchronous daemons, see [[Daemon class#Asynchronous and Independent daemons|"Asynchronous and Independent daemons"]].
</ul>
</ul>



Revision as of 21:14, 31 May 2012

Continue processing asynchronously in daemon (Daemon class)

[Introduced in Sirius Mods 8.1]


This method tells a daemon that issued a Daemon class ReturnToMaster call to continue processing at the point of the call. Unlike the Continue method, ContinueAsynchronously returns immediately, thus allowing the thread that issued ContinueAsynchronously to run in parallel with the daemon thread.

Syntax

daemon:ContinueAsynchronously[( [Input= object])] Throws DaemonLost, IncorrectDaemonState

Syntax terms

daemon A previously defined Daemon object.
Input This optional, name allowed, argument is an object passed to the daemon thread. This object must be deep copyable, as described in: "Copying objects".

Exceptions

This subroutine can throw the following exceptions:

IncorrectDaemonState
If the daemon thread is not in a ReturnToMaster wait when ContinueAsynchronously is issued, an IncorrectDaemonState exception is thrown. This exception will only be thrown in Sirius Mods version 8.1 and later.

Usage notes

  • The Continue and ContinueIndependently methods also tell a daemon to continue from a ReturnToMaster wait.
  • Once started via ContinueAsynchronously, the daemon thread is considered to be running asynchronously until a WaitAsynchronous is issued against the daemon object. This is the case, even if the daemon thread has completed processing all of the input commands.
  • While the daemon thread is running asynchronously, any methods that require interaction with it cause request cancellation.
  • WaitAsynchronous is used to retrieve any output from the commands run via ContinueAsynchronously. This includes the terminal output and any output or info object.
  • As described in: "Working with Daemon objects", the ContinueAsynchronously commands argument can pass multiple commands to the daemon object.
  • For more information about asynchronous daemons, see "Asynchronous and Independent daemons".

Examples

See also