phobos_db_checkpoint 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b434f50dc535e9cba9803dbc09a8945915a8c413
4
- data.tar.gz: 6e4652af6814ab4ded09e12909ffc0eb8cec5910
3
+ metadata.gz: 780d29aed6d459e239c93d0bd1982964d9ecaaf8
4
+ data.tar.gz: b5e02880a25c59329ce422566e8d23acb59538c4
5
5
  SHA512:
6
- metadata.gz: 7cc89324d8c4a264d0929cabc2aeb200e38f7ff3b23c08e45798057057e11c0896e2548779db00775295ed1489e949cd3cd7cd75eba0af8ebad80fa8dbf3c177
7
- data.tar.gz: 5c0626cfe52e3e6b34f8d193083fa23548e4b9a48c9f220867a708bb3cb1cba3a451a2bb687e40c4e98c0bfef1a29290b3ad79bccb8448d2c22428b82907456c
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
- event_exists = instrument('db_checkpoint.event_already_exists_check', event_metadata) { event.exists? }
27
- if event_exists
28
- instrument('db_checkpoint.event_already_consumed', event_metadata)
29
- return
30
- end
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
- event_action = instrument('db_checkpoint.event_action', event_metadata) do
33
- yield
34
- end
33
+ event_action = instrument('db_checkpoint.event_action', event_metadata) do
34
+ yield
35
+ end
35
36
 
36
- case event_action
37
- when PhobosDBCheckpoint::Ack
38
- instrument('db_checkpoint.event_acknowledged', event_metadata) do
39
- event.acknowledge!(event_action)
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
@@ -1,3 +1,3 @@
1
1
  module PhobosDBCheckpoint
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phobos_db_checkpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Túlio Ornelas