ラチェット ワンプ アプリで react\eventloop を使用してタイマーを実行しています。3600 秒で 1 時間ごとに実行したいのですが、何らかの理由で間隔を 2147 秒より高く設定すると、次の警告が表示されます。
Warning: stream_select(): The microseconds parameter must be greater than 0 in C
:\wamp\www\vendor\react\event-loop\StreamSelectLoop.php on line 255
2147 秒の何がそんなに特別なのですか? そして、この制約を回避するにはどうすればよいですか?
イベントハンドラ
class Pusher implements WampServerInterface, MessageComponentInterface {
private $loop;
}
public function __construct(LoopInterface $loop) {
$this->loop = $loop;
$this->loop->addPeriodicTimer(2147, function() {
//code
});
}
public function onSubscribe(ConnectionInterface $conn, $topic) {}
public function onUnSubscribe(ConnectionInterface $conn, $topic) {}
public function onOpen(ConnectionInterface $conn) {}
public function onClose(ConnectionInterface $conn) {}
public function onCall(ConnectionInterface $conn, $id, $topic, array $params) {}
public function onPublish(ConnectionInterface $conn, $topic, $event {}
public function onError(ConnectionInterface $conn, \Exception $e) {}
サーバー
$loop = Factory::create();
$webSock = new Server($loop);
$webSock->listen(8080, '0.0.0.0');
new IoServer(
new HttpServer(
new WsServer(
new SessionProvider(
new WampServer(
new Pusher($loop)),
$sesshandler
)
)
),
$webSock
);
$loop->run();