php-doc-en/reference/pht/thread/addFileTask.xml
Christoph Michael Becker 9e0f03ac35 Proper variadics instead of pseudo variadics
We markup variadic parameters with the `rep=repeat` standard DocBook
attribute of `<methodparam>`, and use proper variable names instead of
using the old pseudo variable name `...`.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351129 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-02 11:17:26 +00:00

116 lines
2.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="pht-thread.addFileTask" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>pht\Thread::addFileTask</refname>
<refpurpose>File threading</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>pht\Thread::addFileTask</methodname>
<methodparam><type>string</type><parameter>fileName</parameter></methodparam>
<methodparam rep="repeat"><type>mixed</type><parameter>globals</parameter></methodparam>
</methodsynopsis>
<para>
Adds a new file task to a <classname>pht\Thread</classname>s internal task queue.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>func</parameter></term>
<listitem>
<para>
The name of the file to be threaded.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>globals</parameter></term>
<listitem>
<para>
An optional list of arguments for the file. These arguments will be
placed into a <literal>$_THREAD</literal> superglobal, which will be made
available inside of the threaded file. All arguments will be serialised
(since they are being passed to another thread).
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
No return value.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Adding a new file task to a thread</title>
<programlisting role="php">
<![CDATA[
<?php
use pht\Thread;
$thread = new Thread();
$thread->addFileTask('file.php', 1, 2, 3);
$thread->start();
$thread->join();
]]>
</programlisting>
<para>file.php:</para>
<programlisting role="php">
<![CDATA[
<?php
[$one, $two, $three] = $_THREAD;
var_dump($one, $two, $three);
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
int(1)
int(2)
int(3)
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->