diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-05-30 14:21:12 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-06-19 16:26:48 -0400 |
commit | 3539db640767e6dafa652864fc5a5445db4ee697 (patch) | |
tree | d707f794e06cead05b7a0f3f4fca349718d374de /src/example/example.yaml | |
parent | aabc54616fba1ad2c26acaf96ddf682ce3c263f0 (diff) | |
download | phosphor-dbus-monitor-3539db640767e6dafa652864fc5a5445db4ee697.tar.gz phosphor-dbus-monitor-3539db640767e6dafa652864fc5a5445db4ee697.zip |
Add deferrable callbacks
Deferrable callbacks delay callback invocation until a
pre configured length of time has elapsed. One example
scenario where deferrable callbacks help is to avoid
oscillation when testing a condition and making callbacks
frequently.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I180c99b57ec1c9bde4da76d947a026f809341c8a
Diffstat (limited to 'src/example/example.yaml')
-rw-r--r-- | src/example/example.yaml | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/example/example.yaml b/src/example/example.yaml index d76e3ad..899c4c8 100644 --- a/src/example/example.yaml +++ b/src/example/example.yaml @@ -103,14 +103,13 @@ For example for a given event, one may wish to trace multiple messages to the systemd journal. The journal callback does not support tracing multiple messages. To do that, define a callback - group composed of multiple journal callbacks. + group composed of multiple journal callbacks.' - This example callback group only has one member. To add more, add - additional callbacks to the members element.' class: callback callback: group members: - example journal callback + - example deferred condition - name: example count condition description: > @@ -138,3 +137,25 @@ countbound: 3 op: '>=' bound: 115 + +- name: example deferred condition + description: > + 'Deferred conditions operate in the same fashion as conditional callbacks + with the added behavior that when the condition is tested and is met, + invocation of the callback is deferred by the interval specified. + + When the configured time has elapsed, if the condition has not been reevaluated + the callback is invoked. + + Any condition type can be deferred in this way by setting the defer attribute.' + + class: condition + condition: count + paths: example path group + properties: example property group + defer: 1000us + callback: example callback group + countop: '>=' + countbound: 3 + op: '>=' + bound: 115 |