<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Set the timer callback function</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="zmqdevice.setidletimeout.html">ZMQDevice::setIdleTimeout</a></div> <div class="next" style="text-align: right; float: right;"><a href="zmqdevice.settimertimeout.html">ZMQDevice::setTimerTimeout</a></div> <div class="up"><a href="class.zmqdevice.html">ZMQDevice</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="zmqdevice.settimercallback" class="refentry"> <div class="refnamediv"> <h1 class="refname">ZMQDevice::setTimerCallback</h1> <p class="verinfo">(No version information available, might only be in SVN)</p><p class="refpurpose"><span class="refname">ZMQDevice::setTimerCallback</span> — <span class="dc-title">Set the timer callback function</span></p> </div> <div class="refsect1 description" id="refsect1-zmqdevice.settimercallback-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type"><a href="class.zmqdevice.html" class="type ZMQDevice">ZMQDevice</a></span> <span class="methodname"><strong>ZMQDevice::setTimerCallback</strong></span> ( <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$cb_func</code></span> , <span class="methodparam"><span class="type">integer</span> <code class="parameter">$timeout</code></span> [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$user_data</code></span> ] )</div> <p class="para rdfs-comment"> 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. </p> </div> <div class="refsect1 parameters" id="refsect1-zmqdevice.settimercallback-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <span class="term"><em><code class="parameter">cb_func</code></em></span> <dd> <p class="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. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">timeout</code></em></span> <dd> <p class="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. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">user_data</code></em></span> <dd> <p class="para"> Additional data to pass to the callback function. </p> </dd> </dt> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-zmqdevice.settimercallback-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> On success this method returns the current object. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="zmqdevice.setidletimeout.html">ZMQDevice::setIdleTimeout</a></div> <div class="next" style="text-align: right; float: right;"><a href="zmqdevice.settimertimeout.html">ZMQDevice::setTimerTimeout</a></div> <div class="up"><a href="class.zmqdevice.html">ZMQDevice</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>