New (Daemon constructor): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 9: | Line 9: | ||
<td>A previously defined <var>[[Daemon class|Daemon]]</var> object. </td></tr> | <td>A previously defined <var>[[Daemon class|Daemon]]</var> object. </td></tr> | ||
<tr><th><var>%(Daemon)</var></th> | <tr><th><var>%(Daemon)</var></th> | ||
<td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. </td></tr> | <td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|"Usage notes"]], below, for more information about invoking a <var>Daemon</var> <var>Constructor</var>.</td></tr> | ||
<tr><th><var>CopyGlobals</var></th> | <tr><th><var>CopyGlobals</var></th> | ||
<td>An optional, but <var>[[Methods#Named parameters|NameRequired]]</var> parameter whose value is a <var>[[Boolean enumeration]]</var>. | <td>An optional, but <var>[[Methods#Named parameters|NameRequired]]</var> parameter whose value is a <var>[[Boolean enumeration]]</var>. | ||
Line 25: | Line 25: | ||
==Usage notes== | ==Usage notes== | ||
<ul><li><var>New</var> not only creates a Daemon object in the user tables, but it also finds a free sdaemon thread and dedicates it to the issuing user. If no sdaemon threads are available, the request is cancelled. | <ul> | ||
<li>As described in [[Object variables#Using New or other Constructors|"Using New or other Constructors"]], <var>New</var> can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is <var>Null</var>:<p class="code">%daemon = new | |||
%daemon = %(Daemon):new | |||
%daemon = %daemon:new | |||
</p> | |||
<li><var>New</var> not only creates a Daemon object in the user tables, but it also finds a free sdaemon thread and dedicates it to the issuing user. If no sdaemon threads are available, the request is cancelled. | |||
<li>The number of daemons allowed per master thread is limited by the <var>[[MAXDAEM parameter|MAXDAEM]]</var> system parameter, whose default value is 1. | <li>The number of daemons allowed per master thread is limited by the <var>[[MAXDAEM parameter|MAXDAEM]]</var> system parameter, whose default value is 1. | ||
<li>If you specify <code>CopyGlobals=True</code>, and if there is insufficient server space (say, if daemons start out with very big tables, except for GTBL, and the master has a very big GTBL), the daemon fails during initialization. | <li>If you specify <code>CopyGlobals=True</code>, and if there is insufficient server space (say, if daemons start out with very big tables, except for GTBL, and the master has a very big GTBL), the daemon fails during initialization. |
Revision as of 21:25, 27 July 2011
Create a new Daemon (Daemon class)
New creates a new Daemon object instance. It has two, optional, arguments.
Syntax
%daemon = [%(Daemon):]New[( [CopyGlobals= boolean], [Transactional= boolean], - [OpenAll= boolean])] Throws MaxDaemExceeded, NoFreeDaemons, DaemonLost
Syntax terms
%daemon | A previously defined Daemon object. |
---|---|
%(Daemon) | The optional class name in parentheses denotes a Constructor. See "Usage notes", below, for more information about invoking a Daemon Constructor. |
CopyGlobals | An optional, but NameRequired parameter whose value is a Boolean enumeration.
The default is
If set to True :
|
Transactional | An optional, but NameRequired parameter whose value is a Boolean enumeration.
|
Exceptions
This subroutine can throw the following exceptions:
- NoFreeDaemons
- If there are no daemon threads available to service the object, a NoFreeDaemons exception is thrown. This exception will only be thrown in Sirius Mods Version 7.2 and later.
Usage notes
- As described in "Using New or other Constructors", New can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is Null:
%daemon = new %daemon = %(Daemon):new %daemon = %daemon:new
- New not only creates a Daemon object in the user tables, but it also finds a free sdaemon thread and dedicates it to the issuing user. If no sdaemon threads are available, the request is cancelled.
- The number of daemons allowed per master thread is limited by the MAXDAEM system parameter, whose default value is 1.
- If you specify
CopyGlobals=True
, and if there is insufficient server space (say, if daemons start out with very big tables, except for GTBL, and the master has a very big GTBL), the daemon fails during initialization.