Moved $_id from queuehandler to daemon, as other daemons need it too.
This commit is contained in:
parent
1da17f6789
commit
64853769b3
@ -24,6 +24,7 @@ if (!defined('LACONICA')) {
|
|||||||
class Daemon
|
class Daemon
|
||||||
{
|
{
|
||||||
var $daemonize = true;
|
var $daemonize = true;
|
||||||
|
var $_id = 'generic';
|
||||||
|
|
||||||
function __construct($daemonize = true)
|
function __construct($daemonize = true)
|
||||||
{
|
{
|
||||||
@ -35,6 +36,16 @@ class Daemon
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_id()
|
||||||
|
{
|
||||||
|
return $this->_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_id($id)
|
||||||
|
{
|
||||||
|
$this->_id = $id;
|
||||||
|
}
|
||||||
|
|
||||||
function background()
|
function background()
|
||||||
{
|
{
|
||||||
$pid = pcntl_fork();
|
$pid = pcntl_fork();
|
||||||
|
@ -29,7 +29,6 @@ define('QUEUE_HANDLER_HIT_IDLE', 0);
|
|||||||
|
|
||||||
class QueueHandler extends Daemon
|
class QueueHandler extends Daemon
|
||||||
{
|
{
|
||||||
var $_id = 'generic';
|
|
||||||
|
|
||||||
function __construct($id=null, $daemonize=true)
|
function __construct($id=null, $daemonize=true)
|
||||||
{
|
{
|
||||||
@ -55,16 +54,6 @@ class QueueHandler extends Daemon
|
|||||||
return strtolower($this->class_name().'.'.$this->get_id());
|
return strtolower($this->class_name().'.'.$this->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_id()
|
|
||||||
{
|
|
||||||
return $this->_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
function set_id($id)
|
|
||||||
{
|
|
||||||
$this->_id = $id;
|
|
||||||
}
|
|
||||||
|
|
||||||
function transport()
|
function transport()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user