略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: ZMQDevice::setIdleCallback

2024-11-13

ZMQDevice::setIdleCallback

(No version information available, might only be in Git)

ZMQDevice::setIdleCallbackSet the idle callback function

说明

public ZMQDevice::setIdleCallback(callable $cb_func, int $timeout, mixed $user_data = ?): ZMQDevice

Sets the idle callback function. If idle timeout is defined the idle callback function shall be called if the internal poll loop times out without events. If the callback function returns false or a value that evaluates to false the device is stopped. The callback function signature is callback (mixed $user_data).

参数

cb_func

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.

timeout

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.

user_data

Additional data to pass to the callback function.

返回值

On success this method returns the current object.

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/zmqdevice.setidlecallback.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3