ContinueIndependently (Daemon subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Automatically generated page update)
 
mNo edit summary
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Template:Daemon:ContinueIndependently subtitle}}
{{Template:Daemon:ContinueIndependently subtitle}}


This page is [[under construction]].
This method tells a daemon that did a <var>[[ReturnToMaster (Daemon subroutine)|ReturnToMaster]]</var> <var>Daemon</var> class call to continue processing at the point of the call. Unlike the <var>[[Continue (Daemon function)|Continue]]</var> method, <var>ContinueIndependently</var> returns immediately, thus allowing the thread that issued <var>ContinueIndependently</var> to run in parallel with the daemon thread. Unlike <var>[[ContinueAsynchronously (Daemon_subroutine)|ContinueAsynchronously]]</var>, this method makes the <var>daemon</var> thread completely independent of the parent thread, so the daeamon is no longer available.
 
==Syntax==
==Syntax==
{{Template:Daemon:ContinueIndependently syntax}}
{{Template:Daemon:ContinueIndependently syntax}}
Line 7: Line 8:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>daemon</th>
<tr><th>daemon</th>
<td>Daemon object</td></tr>
<td>A previously defined <var>Daemon</var> object. </td></tr>
 
<tr><th><var>Input</var></th>
<tr><th><var>Input</var></th>
<td><var>Boolean</var> value</td></tr>
<td>This optional, [[Notation conventions for methods#Named parameters|name allowed]], argument is an object passed to the <var class="term">daemon</var> thread. This object must be deep copyable, as described in: [[Copying objects|"Copying objects"]].
</table>
</td></tr></table>
 
==Exceptions==
<var>ContinueIndependently</var> can throw the following exception:
<dl>
<dt><var>[[DaemonLost_class|DaemonLost]]</var>
<dd>If <var class="term">daemon</var> is lost (probably restarted), a <var>DaemonLost</var> exception is thrown. Since <var>ContinueIndependently</var> does not wait for the <var>daemon</var> thread to do anything, a <var>DaemonLost</var> exception indicates that the daemon thread was lost <b><i>before</i></b> <var>ContinueIndependently</var> was invoked.
</dl>
 
==Usage notes==
==Usage notes==
<ul>
<li>Issuing <var>ContinueIndependently</var> against a daemon not in a <var>ReturnToMaster</var> wait results in an <var>[[IncorrectDaemonState class|IncorrectDaemonState]]</var> exception.</li>
<li>The <var>[[Continue (Daemon function)|Continue]]</var> and <var>[[ContinueAsynchronously (Daemon subroutine)|ContinueAsynchronously]]</var> methods also tell a daemon to continue from a <var>ReturnToMaster</var> wait.</li>
<li>After a <var>ContinueIndependently</var> (or <var>[[RunIndependently (Daemon subroutine)|RunIndependently]]</var>) method, the <var class="term">daemon</var> object is set to null. This is because the <var class="term">daemon</var> thread runs completely independently of the parent thread once a <var>ContinueIndependently</var> method is invoked.
<li>No <var>Daemon</var> class mechanism is provided for a parent thread to retrieve the output from an independently running <var>Daemon</var>.
<li>For more information about independent daemons, see [[Daemon class#Asynchronous and Independent daemons|"Asynchronous and Independent daemons"]].
</ul>
==Examples==
==Examples==
==See also==
==See also==
{{Template:Daemon:ContinueIndependently footer}}
{{Template:Daemon:ContinueIndependently footer}}

Latest revision as of 16:02, 5 August 2014

Continue processing independently in daemon (Daemon class)

[Introduced in Sirius Mods 8.1]


This method tells a daemon that did a ReturnToMaster Daemon class call to continue processing at the point of the call. Unlike the Continue method, ContinueIndependently returns immediately, thus allowing the thread that issued ContinueIndependently to run in parallel with the daemon thread. Unlike ContinueAsynchronously, this method makes the daemon thread completely independent of the parent thread, so the daeamon is no longer available.

Syntax

daemon:ContinueIndependently[( [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

ContinueIndependently can throw the following exception:

DaemonLost
If daemon is lost (probably restarted), a DaemonLost exception is thrown. Since ContinueIndependently does not wait for the daemon thread to do anything, a DaemonLost exception indicates that the daemon thread was lost before ContinueIndependently was invoked.

Usage notes

  • Issuing ContinueIndependently against a daemon not in a ReturnToMaster wait results in an IncorrectDaemonState exception.
  • The Continue and ContinueAsynchronously methods also tell a daemon to continue from a ReturnToMaster wait.
  • After a ContinueIndependently (or RunIndependently) method, the daemon object is set to null. This is because the daemon thread runs completely independently of the parent thread once a ContinueIndependently method is invoked.
  • No Daemon class mechanism is provided for a parent thread to retrieve the output from an independently running Daemon.
  • For more information about independent daemons, see "Asynchronous and Independent daemons".

Examples

See also