From d5f83d92521dbf838b1fc1fad2716efc3122c6b7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 30 Aug 2008 20:32:10 -0400 Subject: switch around how XMLStream does processing darcs-hash:20080831003210-84dde-92ccffd5b2e1d50963b18babd93c70fb1d20cdba.gz --- scripts/xmppconfirmhandler.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'scripts/xmppconfirmhandler.php') diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index 08a397fc4..7971198b1 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -86,16 +86,10 @@ class XmppConfirmHandler { continue; } } - $this->idle(); + $this->idle(0); } else { # $this->clear_old_confirm_claims(); - $start = microtime(); - $this->idle(); - $used = microtime() - $start; - if ($used < 10000000) { - usleep(10000000 - $used); - } - sleep(10); + $this->idle(10); } } while (true); } @@ -137,16 +131,8 @@ class XmppConfirmHandler { common_log($level, 'XmppConfirmHandler ('. $this->_id .'): '.$msg); } - function idle() { - $this->log(LOG_DEBUG, 'Checking the incoming message queue.'); - # Process the queue for a second - if ($this->conn->readyToProcess()) { - $this->log(LOG_DEBUG, 'Something in the incoming message queue; processing it.'); - $this->conn->processTime(1); - $this->log(LOG_DEBUG, 'Done processing incoming message queue.'); - } else { - $this->log(LOG_DEBUG, 'Nothing in the incoming message queue; skipping it.'); - } + function idle($timeout=0) { + $this->conn->processTime($timeout); } function forward_message(&$pl) { -- cgit v1.2.3-54-g00ecf