better handling of frames and notices
This commit is contained in:
parent
cb019f7aad
commit
23e6dafff6
|
@ -37,7 +37,6 @@ class StompQueueManager
|
||||||
var $password = null;
|
var $password = null;
|
||||||
var $base = null;
|
var $base = null;
|
||||||
var $con = null;
|
var $con = null;
|
||||||
var $frames = array();
|
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
@ -97,13 +96,19 @@ class StompQueueManager
|
||||||
|
|
||||||
$frame = $this->con->readFrame();
|
$frame = $this->con->readFrame();
|
||||||
|
|
||||||
if ($frame) {
|
if (!empty($frame)) {
|
||||||
$notice = Notice::staticGet($frame->body);
|
$notice = Notice::staticGet('id', $frame->body);
|
||||||
|
|
||||||
if ($handler->handle_notice($notice)) {
|
if (empty($notice)) {
|
||||||
|
$this->_log(LOG_WARNING, 'Got ID '. $frame->body .' for non-existent notice');
|
||||||
|
$this->con->ack($frame);
|
||||||
|
} else if ($handler->handle_notice($notice)) {
|
||||||
$this->_log(LOG_INFO, 'Successfully handled notice '. $notice->id .' posted at ' . $frame->headers['created']);
|
$this->_log(LOG_INFO, 'Successfully handled notice '. $notice->id .' posted at ' . $frame->headers['created']);
|
||||||
$this->con->ack($frame);
|
$this->con->ack($frame);
|
||||||
|
unset($notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
$handler->idle(0);
|
$handler->idle(0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user