[kea-dev] Another hook suggestion: configurable periodic timers

Chaigneau, Nicolas nicolas.chaigneau at capgemini.com
Wed Nov 19 16:50:41 UTC 2014


Hello again,



Another need I have is to perform periodic actions within a hook library.

A hacky way to do so is, for instance, on a trigger "pkt4_receive":
Check if it's time to perform the periodic action, then rearm the timer afterwards (ie, set the future timestamp at which the action should be handled again).
The drawback is that it depends on traffic being sent to the server. And it's not a terribly clean way to handle this...

(Still, it works. So the following proposal is not of high priority or anything; I'm just opening the discussion.)

I think of the following:


Allow to define in configuration a list of timers, each of which would be composed of a period and identifier.
For instance, with a timer of 5 min and one of 1H:

	"periodic-timers": [
		{
			"id": "timer-monitor"
			"period": 300,
		},
		{
			"id": "timer-1H"
			"period": 3600,
		}
	]

Kea would trigger a new hook "periodic timer" each time the period of one of the timers is reached.
The hook library would receive both "id" and "period" arguments, which would allow to decide what to do (or do nothing).



(apologies for overloading the mailing list; this will be my last one for today, I promise !)


Regards,
Nicolas.

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.



More information about the kea-dev mailing list