Package pgq :: Module ticker :: Class SmartTicker
[frames] | no frames]

Class SmartTicker

source code

                 object --+    
                          |    
skytools.scripting.DBScript --+
                              |
                             SmartTicker

Instance Methods
 
__init__(self, args)
Script setup.
source code
 
reload(self)
Reload config.
source code
 
startup(self)
Will be called just before entering main loop.
source code
 
refresh_queues(self, cx) source code
 
work(self)
Here should user's processing happen.
source code

Inherited from skytools.scripting.DBScript: close_database, get_database, hook_sighup, hook_sigint, init_optparse, reset, run, run_once, send_signal, send_stats, set_single_loop, start, stat_add, stat_increase, stat_put, stop

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  last_tick_event = 0
  last_tick_time = 0
  quiet_count = 0
  tick_count = 0
  maint_thread = None

Inherited from skytools.scripting.DBScript: cf, job_name, log, service_name

Properties

Inherited from object: __class__

Method Details

__init__(self, args)
(Constructor)

source code 

Script setup.

User class should override work() and optionally __init__(), startup(), reload(), reset() and init_optparse().

NB: in case of daemon, the __init__() and startup()/work() will be run in different processes. So nothing fancy should be done in __init__().
Overrides: skytools.scripting.DBScript.__init__
(inherited documentation)

reload(self)

source code 
Reload config.
Overrides: skytools.scripting.DBScript.reload
(inherited documentation)

startup(self)

source code 

Will be called just before entering main loop.

In case of daemon, if will be called in same process as work(), unlike __init__().
Overrides: skytools.scripting.DBScript.startup
(inherited documentation)

work(self)

source code 
Here should user's processing happen.
Overrides: skytools.scripting.DBScript.work
(inherited documentation)