resources: rate limiting: Implement resource rate limiting

This adds rate limiting with the limit and burst meta parameters. The
limits apply to how often the Process check is called. As a result, it
might get called more often than there are Watch events due to possible
Poke/BackPoke events.

This system might need to get rethought in the future depending on its
usefulness.
This commit is contained in:
James Shubin
2017-01-16 18:53:46 -05:00
parent 2a6df875ec
commit 4f34f7083b
4 changed files with 78 additions and 6 deletions

13
examples/file4.yaml Normal file
View File

@@ -0,0 +1,13 @@
---
graph: mygraph
resources:
file:
- name: file1
path: "/tmp/mgmt/f1"
meta:
limit: 0.5
burst: 3
content: |
i am f1
state: exists
edges: []