<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.zmqdevice.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'zmqdevice.settimercallback.php',
    1 => 'ZMQDevice::setTimerCallback',
    2 => 'Set the timer callback function',
  ),
  'up' => 
  array (
    0 => 'class.zmqdevice.php',
    1 => 'ZMQDevice',
  ),
  'prev' => 
  array (
    0 => 'zmqdevice.setidletimeout.php',
    1 => 'ZMQDevice::setIdleTimeout',
  ),
  'next' => 
  array (
    0 => 'zmqdevice.settimertimeout.php',
    1 => 'ZMQDevice::setTimerTimeout',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/zmq/zmqdevice/settimercallback.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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 Git)</p><p class="refpurpose"><span class="refname">ZMQDevice::setTimerCallback</span> &mdash; <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="methodname"><strong>ZMQDevice::setTimerCallback</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$cb_func</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$timeout</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$user_data</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="class.zmqdevice.php" class="type ZMQDevice">ZMQDevice</a></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><code class="parameter">cb_func</code></dt>
    <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><code class="parameter">timeout</code></dt>
    <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><code class="parameter">user_data</code></dt>
    <dd>
     <p class="para">
      Additional data to pass to the callback function.
     </p>
    </dd>
   
  </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><?php manual_footer($setup); ?>