AmDaemon (Daemon property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (add link)
 
(31 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Template:Daemon:AmDaemon subtitle}}


<span class="pageSubtitle"><section begin=dpl_desc/>Checks whether the thread is a daemon.<section end=dpl_desc/></span>
<var>AmDaemon</var> returns a <var>[[Boolean enumeration]]</var> to indicate whether <var>AmDaemon</var> was issued on a daemon thread associated with a <var>Daemon</var> object.
 
AmDaemon is a member of the [[Daemon class]]
 
This shared method confirms whether the current thread is controlled by a Daemon object. The method takes no arguments and returns a boolean enumeration.


==Syntax==
==Syntax==
{{Template:Daemon:AmDaemon syntax}}
{{Template:Daemon:AmDaemon syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table>
<tr><th><i>%bool</i></th>
<tr><th>%boolean</th>
<td>A declared enumeration object of type Boolean to contain the returned value of AmDaemon. </td></tr>
<td>An enumeration object of type <var>Boolean</var> to contain the returned value of <var>AmDaemon</var>. <var>AmDaemon</var> returns <code>True</code> if issued on a <var>Daemon</var>-associated thread; otherwise it returns <code>False</code>.</td></tr>
<tr><th>%(Daemon)</th>
 
<td>The class name in parentheses denotes a shared method. Specifying <tt>%(Daemon):</tt> is not the only way to invoke the method (see :hdref refid=daemeth.).</td></tr>
<tr><th><var class="nobr">%(Daemon)</var></th>
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>AmDaemon</var> can also be invoked via a <var>Daemon</var> object variable, which may be <var>Null</var>.</td></tr>
</table>
</table>
 
AmDaemon returns <tt>True</tt> if issued on a daemon thread; otherwise it returns <tt>False</tt>.
==Usage notes==
<ul>
<li>Since a daemon thread can run web requests, socket server requests, and <var>$CommndL</var> requests, <var>AmDaemon</var> distinguishes a daemon thread that is working for a <var>Daemon</var> object
from, say, a daemon thread running a web request. This distinction is particularly important for certain methods, such as <var>ReturnToMaster</var> or <var>ReturnObject</var>, that can only be issued on a thread associated with a <var>Daemon</var> object. </li>
 
<li>If a daemon thread was spawned by <var>[[RunIndependently (Daemon subroutine)|RunIndependently]]</var>, <var>AmDaemon</var> returns <code>False</code> since the daemon thread has no returnable objects. </li>
</ul>


==See also==
==See also==
{{Template:Daemon:AmDaemon footer}}
{{Template:Daemon:AmDaemon footer}}

Latest revision as of 16:34, 27 August 2018

Is the current thread controlled by a Daemon? (Daemon class)


AmDaemon returns a Boolean enumeration to indicate whether AmDaemon was issued on a daemon thread associated with a Daemon object.

Syntax

%boolean = %(Daemon):AmDaemon

Syntax terms

%boolean An enumeration object of type Boolean to contain the returned value of AmDaemon. AmDaemon returns True if issued on a Daemon-associated thread; otherwise it returns False.
%(Daemon) The class name in parentheses denotes a shared method. AmDaemon can also be invoked via a Daemon object variable, which may be Null.

Usage notes

  • Since a daemon thread can run web requests, socket server requests, and $CommndL requests, AmDaemon distinguishes a daemon thread that is working for a Daemon object from, say, a daemon thread running a web request. This distinction is particularly important for certain methods, such as ReturnToMaster or ReturnObject, that can only be issued on a thread associated with a Daemon object.
  • If a daemon thread was spawned by RunIndependently, AmDaemon returns False since the daemon thread has no returnable objects.

See also