php-doc-en/reference/zmq/zmqdevice/settimercallback.xml
2018-01-25 15:56:34 +00:00

91 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="zmqdevice.settimercallback" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ZMQDevice::setTimerCallback</refname>
<refpurpose>Set the timer callback function</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>ZMQDevice</type><methodname>ZMQDevice::setTimerCallback</methodname>
<methodparam><type>callable</type><parameter>cb_func</parameter></methodparam>
<methodparam><type>int</type><parameter>timeout</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>user_data</parameter></methodparam>
</methodsynopsis>
<para>
Sets the timer callback function. The timer callback will be invoked after timeout has
passed. The difference between idle and timer callbacks are that idle callback is invoked
only when the device is idle.
The callback function signature is callback (mixed $user_data). Added in ZMQ extension version 1.1.0.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>cb_func</parameter></term>
<listitem>
<para>
Callback function to invoke when the device is idle. Returning false
or a value that evaluates to false from this function will cause the
device to stop.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>timeout</parameter></term>
<listitem>
<para>
How often to invoke the idle callback in milliseconds. The idle callback is invoked
periodically when there is no activity on the device.
The timeout value guarantees that there is at least this amount of milliseconds between
invocations of the callback function.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_data</parameter></term>
<listitem>
<para>
Additional data to pass to the callback function.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
On success this method returns the current object.
</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
-->