Go to the source code of this file.
Defines | |
#define | SCHEDULE_IMMEDIATE_DELAY 1 |
seconds before immediately due timeout | |
#define | SCHEDULE_PERIOD 10 |
seconds before next due timeout | |
#define | SCHEDULE_RESTART_TIME 120 |
seconds before a retry after a stop | |
#define | SCHEDULE_STOP_RETRY 10 |
if we have more than MAX_RETRY_ATTEMPTS within this (SCHEDULE_STOP_RETRY) many seconds, then we stop for SCHEDULE_RESTART_TIME | |
#define | MAX_RETRY_ATTEMPTS 3 |
number of retries associated with SCHEDULE_STOP_RETRY | |
Functions | |
int | ped_schedule_init (void) |
void | ped_schedule_reset (void) |
void | ped_schedule_stop (void) |
Functions to initialize timer infrastruture and register periodic updates
Definition in file ped_schedule.h.
int ped_schedule_init | ( | void | ) |
Initialize the internals necessary for the periodic timer/scheduler. Does not set timers. That's done with ped_schedule_reset. This must be called before using ped_schedule_reset.
Definition at line 164 of file ped_schedule.c.
References period, SCHEDULE_PERIOD, and timer_set.
Referenced by ped_init().
void ped_schedule_reset | ( | void | ) |
Clear existing timer if it exists, and set the timer fresh again. Starts a periodic timer every SCHEDULE_PERIOD seconds, and a one-shot timer that goes off in SCHEDULE_IMMEDIATE_DELAY seconds. Timer callback is ped_periodic.
If we're resetting, then something went wrong most likely (or it's a configuration load/reload) so we have a small delay timer before retrying. If all goes well, then the periodic timer will continue checks after that.
Definition at line 187 of file ped_schedule.c.
References ped_ctx, ped_periodic(), period, SCHEDULE_IMMEDIATE_DELAY, timer_id, and timer_set.
Referenced by ped_init(), ped_periodic(), and ped_restart().
void ped_schedule_stop | ( | void | ) |
Clear existing schedule for shutdown
Definition at line 221 of file ped_schedule.c.