In Consul v0.8.4 or later, consul watch -type event HANDLER
gives same events several time to the HANDLER
.
- Invoke
consul watch -type event HANDLER
to wait events - Invoke
consul event -name "foo"
several time to fire events
consul watch -type event HANDLER
invokes HANDLER
with newly appeared events
consul watch -type event HANDLER
invokes HANDLER
several time with the same events.
$ consul version
Consul v0.8.3
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
$ for i in $(seq 1 10); do consul event -name "event"; done
Event ID: 37df5521-f043-7a52-0538-b99d6279e667
Event ID: 3506479b-41d8-76c5-0a9d-013ed492fc19
Event ID: 811d0f92-16b5-2eb3-6bb9-c96de7dfeb06
Event ID: e98cebe6-6671-9b40-b4d9-2c5ddadb40cd
Event ID: 34f08433-2ed3-7d06-4038-c202386477e8
Event ID: 9f1735bf-7400-fff1-a5d5-1a98cdb7c400
Event ID: b7074e89-ba9e-ab60-94c2-7d7868941d02
Event ID: 176aeca9-5d70-2e6d-ea77-541e995ed0d9
Event ID: 8c720cd2-4d63-d342-b45d-891cd051e626
Event ID: eaf5ecc1-d269-5537-ef6b-8e00bc071371
$ consul watch -type event sh -c "date; jq -r '.[].ID'"
Fri Oct 27 11:01:31 UTC 2017
Fri Oct 27 11:01:36 UTC 2017
37df5521-f043-7a52-0538-b99d6279e667
Fri Oct 27 11:01:37 UTC 2017
e98cebe6-6671-9b40-b4d9-2c5ddadb40cd
811d0f92-16b5-2eb3-6bb9-c96de7dfeb06
3506479b-41d8-76c5-0a9d-013ed492fc19
Fri Oct 27 11:01:37 UTC 2017
9f1735bf-7400-fff1-a5d5-1a98cdb7c400
34f08433-2ed3-7d06-4038-c202386477e8
Fri Oct 27 11:01:37 UTC 2017
b7074e89-ba9e-ab60-94c2-7d7868941d02
8c720cd2-4d63-d342-b45d-891cd051e626
176aeca9-5d70-2e6d-ea77-541e995ed0d9
Fri Oct 27 11:01:37 UTC 2017
eaf5ecc1-d269-5537-ef6b-8e00bc071371
$ consul version
Consul v0.8.4
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
$ for i in $(seq 1 10); do consul event -name "event"; done
Event ID: a370f3c8-ea35-7a39-b710-41e171f2bb64
Event ID: dea287bd-28a5-36dc-299a-1e67f73916b3
Event ID: f1de4eba-3e01-b432-5f68-ffe727f18788
Event ID: 88641f05-4c18-69ea-fbb5-833b37820fc3
Event ID: f8c6f6f3-3ac0-3108-c2e3-6237e66c155d
Event ID: 47dcae4b-7077-c9f1-d772-5d0cf2e9193e
Event ID: 29a1a3be-d334-5307-968f-129113070a28
Event ID: 2b5accb7-11e7-7dbf-b03f-b8c6370f062d
Event ID: 4d9741a5-e940-87f8-1169-ab5c0b015294
Event ID: 2ac54867-15ee-073f-db3b-ec658631b0d2
For example, a370f3c8-ea35-7a39-b710-41e171f2bb64
is given to the child process 4 times.
$ consul watch -type event sh -c "date; jq -r '.[].ID'"
Fri Oct 27 10:57:02 UTC 2017
Fri Oct 27 10:57:09 UTC 2017
a370f3c8-ea35-7a39-b710-41e171f2bb64
Fri Oct 27 10:57:09 UTC 2017
f1de4eba-3e01-b432-5f68-ffe727f18788
dea287bd-28a5-36dc-299a-1e67f73916b3
Fri Oct 27 10:57:09 UTC 2017
88641f05-4c18-69ea-fbb5-833b37820fc3
Fri Oct 27 10:57:09 UTC 2017
a370f3c8-ea35-7a39-b710-41e171f2bb64
f1de4eba-3e01-b432-5f68-ffe727f18788
dea287bd-28a5-36dc-299a-1e67f73916b3
88641f05-4c18-69ea-fbb5-833b37820fc3
Fri Oct 27 10:57:09 UTC 2017
47dcae4b-7077-c9f1-d772-5d0cf2e9193e
f8c6f6f3-3ac0-3108-c2e3-6237e66c155d
Fri Oct 27 10:57:09 UTC 2017
a370f3c8-ea35-7a39-b710-41e171f2bb64
f1de4eba-3e01-b432-5f68-ffe727f18788
dea287bd-28a5-36dc-299a-1e67f73916b3
88641f05-4c18-69ea-fbb5-833b37820fc3
47dcae4b-7077-c9f1-d772-5d0cf2e9193e
f8c6f6f3-3ac0-3108-c2e3-6237e66c155d
Fri Oct 27 10:57:10 UTC 2017
2b5accb7-11e7-7dbf-b03f-b8c6370f062d
29a1a3be-d334-5307-968f-129113070a28
Fri Oct 27 10:57:10 UTC 2017
2ac54867-15ee-073f-db3b-ec658631b0d2
4d9741a5-e940-87f8-1169-ab5c0b015294
Fri Oct 27 10:57:10 UTC 2017
a370f3c8-ea35-7a39-b710-41e171f2bb64
f1de4eba-3e01-b432-5f68-ffe727f18788
dea287bd-28a5-36dc-299a-1e67f73916b3
88641f05-4c18-69ea-fbb5-833b37820fc3
47dcae4b-7077-c9f1-d772-5d0cf2e9193e
f8c6f6f3-3ac0-3108-c2e3-6237e66c155d
2b5accb7-11e7-7dbf-b03f-b8c6370f062d
29a1a3be-d334-5307-968f-129113070a28
2ac54867-15ee-073f-db3b-ec658631b0d2
4d9741a5-e940-87f8-1169-ab5c0b015294
$ consul version
Consul v1.0.0-330-g1f5b708-dev (1f5b708)
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
$ for i in $(seq 1 10); do consul event -name "event"; done
Event ID: f65b1197-220b-9ff3-6217-f3e9dae3b0e5
Event ID: 4be4258e-f524-1b38-f126-1be883f8a26c
Event ID: 168d8659-107d-d915-8c6b-11dfb73c6519
Event ID: 8fe4128f-ce79-c7fd-5159-e2bc048c9a28
Event ID: 8d159547-0240-5090-01b9-be6f6087c282
Event ID: d624c7ce-f3a9-7f2e-992e-1704916595ee
Event ID: 451c14e6-d858-8bb4-6dc1-1554505cc9f3
Event ID: b40796f0-1b4e-fa91-3d94-139aa76f220b
Event ID: 7c9c153b-7a4a-f7ee-1326-ec3971437d37
Event ID: d12f5ae7-eb7b-4037-c51e-f3b3801a6f87
$ consul watch -type event sh -c "date; jq -r '.[].ID'"
Fri Oct 27 10:51:21 UTC 2017
Fri Oct 27 10:52:03 UTC 2017
4be4258e-f524-1b38-f126-1be883f8a26c
f65b1197-220b-9ff3-6217-f3e9dae3b0e5
Fri Oct 27 10:52:03 UTC 2017
8fe4128f-ce79-c7fd-5159-e2bc048c9a28
168d8659-107d-d915-8c6b-11dfb73c6519
Fri Oct 27 10:52:03 UTC 2017
d624c7ce-f3a9-7f2e-992e-1704916595ee
8d159547-0240-5090-01b9-be6f6087c282
Fri Oct 27 10:52:04 UTC 2017
7c9c153b-7a4a-f7ee-1326-ec3971437d37
b40796f0-1b4e-fa91-3d94-139aa76f220b
451c14e6-d858-8bb4-6dc1-1554505cc9f3
Fri Oct 27 10:52:04 UTC 2017
d12f5ae7-eb7b-4037-c51e-f3b3801a6f87