summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt4
-rw-r--r--pysnmp/carrier/base.py14
2 files changed, 17 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 24e490e0..8942df65 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,7 +2,9 @@
Revision 4.4.10, released 2019-04-XX
------------------------------------
-- Respect non-default timer resolution in asyncore main loop
+- Fix to respect non-default timer resolution in asyncore main loop
+- Fix to update call interval of the existing periodic dispatcher jobs
+ on interval change (via .setTimerResolution())
Revision 4.4.9, released 2019-02-09
-----------------------------------
diff --git a/pysnmp/carrier/base.py b/pysnmp/carrier/base.py
index 51a2d0b5..40b8d78a 100644
--- a/pysnmp/carrier/base.py
+++ b/pysnmp/carrier/base.py
@@ -36,6 +36,14 @@ class TimerCallable(object):
def __ge__(self, cbFun):
return self.__cbFun >= cbFun
+ @property
+ def interval(self):
+ return self.__callInterval
+
+ @interval.setter
+ def interval(self, callInterval):
+ self.__callInterval = callInterval
+
class AbstractTransportDispatcher(object):
def __init__(self):
@@ -151,6 +159,12 @@ class AbstractTransportDispatcher(object):
def setTimerResolution(self, timerResolution):
if timerResolution < 0.01 or timerResolution > 10:
raise error.CarrierError('Impossible timer resolution')
+
+ for timerCallable in self.__timerCallables:
+ if timerCallable.interval == self.__timerResolution:
+ # Update periodics for default resolutions
+ timerCallable.interval = timerResolution
+
self.__timerResolution = timerResolution
self.__timerDelta = timerResolution * 0.05