downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

EvWatcher::setCallback> <EvWatcher::invoke
[edit] Last updated: Fri, 24 May 2013

view this page in

EvWatcher::keepalive

(PECL ev >= 0.2.0)

EvWatcher::keepaliveConfigures whether to keep the loop from returning

Descripción

public bool EvWatcher::keepalive ([ bool $value ] )

Configures whether to keep the loop from returning. With keepalive value set to FALSE the watcher won't keep Ev::run() / EvLoop::run() from returning even though the watcher is active.

Watchers have keepalive value TRUE by default.

Clearing keepalive status is useful when returning from Ev::run() / EvLoop::run() just because of the watcher is undesirable. It could be a long running UDP socket watcher or so.

Parámetros

value

With keepalive value set to FALSE the watcher won't keep Ev::run() / EvLoop::run() from returning even though the watcher is active.

Valores devueltos

Returns the previous state.

Ejemplos

Ejemplo #1 Register an I/O watcher for some UDP socket but do not keep the event loop from running just because of that watcher.

<?php
$udp_socket 
= ...
$udp_watcher = new EvIo($udp_socketEv::READ, function () { /* ... */ });
$udp_watcher->keepalive(FALSE);
?>


add a note add a note User Contributed Notes EvWatcher::keepalive - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites