We could allow passing a function callback to the "spacing" parameter of the @periodic decorator, that would make it more flexible and would enable things like refreshing the interval values when the service re-loads the configuration file (in case of a SIGHUP). For example:
We could allow passing a function callback to the "spacing" parameter of the @periodic decorator, that would make it more flexible and would enable things like refreshing the interval values when the service re-loads the configuration file (in case of a SIGHUP). For example:
def _sync_states(): states_ interval
return CONF.sync_
class Foo(object):
@periodics .periodic( spacing= _sync_states)
def sync_states(self):
...