phobos_db_checkpoint 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/lib/phobos_db_checkpoint/handler.rb +16 -14
- data/lib/phobos_db_checkpoint/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 780d29aed6d459e239c93d0bd1982964d9ecaaf8
|
4
|
+
data.tar.gz: b5e02880a25c59329ce422566e8d23acb59538c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 042e4635cd5939215f3afbc3468c07a26efbe7c3998a9c5484d21595f2a12ccdf978b44aa16970f55b4e1b11bb9a90da86b755eac67f16f617571dbfed731818
|
7
|
+
data.tar.gz: 7b24abd6b44be10026d371339f8b1dade902bb07dcec2ea99299661c8f5e3aa3c3c7c83b4fa215259aef5c6fb5ce1b0532e1a19446c633ff0169611e000b52c1
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## 0.5.0 (2016-12-28)
|
8
|
+
|
9
|
+
- [feature] Add another instrumentation to wrap the entire around consume
|
10
|
+
|
7
11
|
## 0.4.0 (2016-12-28)
|
8
12
|
|
9
13
|
- [feature] Add more instrumentation for consuming
|
data/README.md
CHANGED
@@ -170,6 +170,7 @@ Some operations are instrumented using [Phobos::Instrumentation](https://github.
|
|
170
170
|
#### Handler notifications
|
171
171
|
|
172
172
|
Overview of the built in notifications:
|
173
|
+
* `db_checkpoint.around_consume` is sent when the event has run all logic in `around_consume`, this encompasses many of the below instrumentations at a higher level
|
173
174
|
* `db_checkpoint.event_already_exists_check` is sent when the event has been queried for existence in the database
|
174
175
|
* `db_checkpoint.event_action` is sent when the event action has completed
|
175
176
|
* `db_checkpoint.event_acknowledged` is sent when the event is acknowledged (saved)
|
@@ -23,23 +23,25 @@ module PhobosDBCheckpoint
|
|
23
23
|
|
24
24
|
event_metadata = { checksum: event.checksum }.merge(metadata)
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
instrument('db_checkpoint.around_consume', event_metadata) do
|
27
|
+
event_exists = instrument('db_checkpoint.event_already_exists_check', event_metadata) { event.exists? }
|
28
|
+
if event_exists
|
29
|
+
instrument('db_checkpoint.event_already_consumed', event_metadata)
|
30
|
+
return
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
event_action = instrument('db_checkpoint.event_action', event_metadata) do
|
34
|
+
yield
|
35
|
+
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
case event_action
|
38
|
+
when PhobosDBCheckpoint::Ack
|
39
|
+
instrument('db_checkpoint.event_acknowledged', event_metadata) do
|
40
|
+
event.acknowledge!(event_action)
|
41
|
+
end
|
42
|
+
else
|
43
|
+
instrument('db_checkpoint.event_skipped', event_metadata)
|
40
44
|
end
|
41
|
-
else
|
42
|
-
instrument('db_checkpoint.event_skipped', event_metadata)
|
43
45
|
end
|
44
46
|
ensure
|
45
47
|
# Returns any connections in use by the current thread back to the pool, and also returns
|