All help topics · Link to this topic
Showing help on 'queued_tasks()'
Syntax: queued_tasks ([INT <show-runtime-or-count-only> [, INT <count-only>]]) => LIST|INTReturns information on each of the background tasks (i.e., forked, suspended, or reading) owned by the programmer (or, if the programmer is a wizard, all queued tasks). The returned value is a list of lists, each of which encodes certain information about a particular queued task in the following format:
{<task-id>, <start-time>, <ticks>, <clock-id>,
<programmer>, <verb-loc>, <verb-name>, <line>, <this>, <task-size>}
where <task-id> is a numeric identifier for this queued task, <start-time> is the time after which this task will begin execution (in `time()' format), <ticks> is the number of ticks this task will have when it starts (always 20,000 now, though this is changeable. This makes this value obsolete and no longer interesting), <clock-id> is a number whose value is no longer interesting, <programmer> is the permissions with which this task will begin execution (and also the player who "owns" this task), <verb-loc> is the object on which the verb that forked this task was defined at the time, <verb-name> is that name of that verb, <line> is the number of the first line of the code in that verb that this task will execute, and <this> is the value of the variable `this' in that verb. For reading tasks, <start-time> is `-1'. <task-size> is in bytes, and is the size of memory in use by the task for local variables, stack frames, etc.
If exactly one argument is provided and it is true, all variables present in the task are presented in a map with the variable name as the key and its value as the value.
If two arguments are provided and the second argument is true, then only the number of tasks is returned. This is significantly more performant than length(queued_tasks()). Runtime variables are not included when two arguments are provided, so queued_tasks(1, 0) returns the normal task list without runtime variables.
The <ticks> and <clock-id> fields are now obsolete and are retained only for backward-compatibility reasons. They may disappear in a future version of the server.