interface
[ class tree: interface ] [ index: interface ] [ all elements ]

Class: Kimono_Daemon

Source Location: /interface/daemon/daemon.php

Class Overview


monitor daemon


Methods



Class Details

[line 82]
monitor daemon

the daemon work with counters (Kimono_Counter) to handle recurring tasks like processing commands sent to the database, update its status to the database, process services ready to run and keep the service runtime table up-to-date. the counter functions are executed at different intervals specified in the database to keep the database usage at a decent level.




[ Top ]


Class Methods


constructor __construct [line 103]

Kimono_Daemon __construct( )

set up error and config handlers



[ Top ]

method ActivateSignalHandler [line 137]

void ActivateSignalHandler( )

hook up signal handler if PCNTL is available



[ Top ]

method CreatePID [line 511]

void CreatePID( )

create pid (process id) file on disk

note: posix_getpid() is not available on windows




[ Top ]

method GetArgument [line 491]

void GetArgument( mixed $string)

reuturns argument value (after the = character)



[ Top ]

method GetServiceBuffer [line 298]

void GetServiceBuffer( )

go through buffer and form a new array of the services that are to be executed,

delete them from the service buffer and return the new array




[ Top ]

method hasPID [line 541]

void hasPID( )

exits script if the PID file exists



[ Top ]

method isArgument [line 472]

void isArgument( )

returns TRUE if one of the arguments exists



[ Top ]

method Kill [line 234]

void Kill( )

set state to SHUTDOWN and the server will die at next loop



[ Top ]

method Maintenance [line 402]

void Maintenance( )

perform database maintenance



[ Top ]

method ProcessArguments [line 451]

void ProcessArguments( )



[ Top ]

method ProcessCommands [line 335]

void ProcessCommands( )

process commands in the queue and update daemon status afterwards



[ Top ]

method Reload [line 211]

void Reload( )

reload data



[ Top ]

method RemovePID [line 532]

void RemovePID( )

remove PID file from disk



[ Top ]

method Reschedule [line 322]

void Reschedule( )



[ Top ]

method SendStatistics [line 379]

void SendStatistics( )

send anonymous statistics to downshift.org



[ Top ]

method SetupServer [line 415]

void SetupServer( )

set up server, check for errors, switch to non-blocking mode and check for errors again,

return TRUE/FALSE depending on outcome




[ Top ]

method SignalHandler [line 122]

void SignalHandler( mixed $signal, integer $signo)

signal handler



Parameters:

integer   $signo   signal we need to deal with

[ Top ]

method Start [line 151]

void Start( )

start daemon and keep it running



[ Top ]

method Status [line 314]

void Status( [mixed $status = FALSE])



[ Top ]

method Stop [line 198]

void Stop( )

stop daemon



[ Top ]

method UpdateBuffer [line 284]

void UpdateBuffer( )



[ Top ]

method UpdateServer [line 438]

void UpdateServer( )



[ Top ]

method UpdateServices [line 255]

void UpdateServices( )

perform updates, run services and update daemon status to avoid server/network activity bursts, usleep() between each service run



Tags:

todo:  only Synchronize() if any services has been run this time


[ Top ]

method UpdateStatus [line 289]

void UpdateStatus( )



[ Top ]

method Uptime [line 556]

void Uptime( )

return uptime in seconds or formatted



[ Top ]


Documentation generated on Fri, 8 Apr 2005 18:27:48 +0200 by phpDocumentor 1.3.0RC3