Changeset View
Changeset View
Standalone View
Standalone View
src/future/Future.php
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | public static function waitForSockets( | ||||
$timeout_sec = (int)$timeout; | $timeout_sec = (int)$timeout; | ||||
$timeout_usec = (int)(1000000 * ($timeout - $timeout_sec)); | $timeout_usec = (int)(1000000 * ($timeout - $timeout_sec)); | ||||
$exceptfds = array(); | $exceptfds = array(); | ||||
$ok = @stream_select( | $ok = @stream_select( | ||||
$read_list, | $read_list, | ||||
$write_list, | $write_list, | ||||
$exceptfds, | $exceptfds, | ||||
$timeout, | $timeout_sec, | ||||
$timeout_usec); | $timeout_usec); | ||||
if ($ok === false) { | if ($ok === false) { | ||||
// Hopefully, means we received a SIGCHLD. In the worst case, we degrade | // Hopefully, means we received a SIGCHLD. In the worst case, we degrade | ||||
// to a busy wait. | // to a busy wait. | ||||
} | } | ||||
} | } | ||||
Show All 37 Lines |