codeclimate-kafka 0.7.0 → 0.8.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: 2a6286bc388f0c70ac4bf89f24fa7996812a3ae9
4
- data.tar.gz: bc05415cbf2a51c58269ba831aed92da40f66b3b
3
+ metadata.gz: 640be1086542751177d108122596f0aa7f206498
4
+ data.tar.gz: 4699108520869f781beb4a5cc997055b7bd60e12
5
5
  SHA512:
6
- metadata.gz: 40f89cba080f1333d0bfa3a374b9edd89668de43d04141006ad271e61a3b3dd350647eccfd9c36fd2e67fcf1c8f89d23d006b5b1c724025d57b71ef27d619c14
7
- data.tar.gz: d7071165d75391cad8dcd4a73bf035f2985dadeb9f2d4dc4b169dc901e29abee21447b316065b31e5acb43c59b1d669bf33531cd721a5931cdd651a5c62610d4
6
+ metadata.gz: f3cbdf78cf0e24306f68e1650ef68dfa685cdba8a226c1d3de6ffc3d3697de8418fde06a85d0a9fd8a1888d5ce6ee2114567a97daad5f661189ca3cddbb4db03
7
+ data.tar.gz: 581f33c8019c6c2eff05638f8df1d158cb715ce98e3cc8c4f8db76cce9e335a62b667aa945e8726c27b3145ea8e20480e220c12759486ee21f6fe7987afefe75
@@ -22,6 +22,14 @@ module CC
22
22
  )
23
23
  end
24
24
 
25
+ def on_start(&block)
26
+ @on_start = block
27
+ end
28
+
29
+ def on_stop(&block)
30
+ @on_stop = block
31
+ end
32
+
25
33
  def on_message(&block)
26
34
  @on_message = block
27
35
  end
@@ -30,6 +38,7 @@ module CC
30
38
  trap(:TERM) { stop }
31
39
 
32
40
  @running = true
41
+ @on_start.call(@offset) if @on_start
33
42
 
34
43
  while @running do
35
44
  fetch_messages
@@ -37,6 +46,8 @@ module CC
37
46
 
38
47
  Kafka.logger.info("shutting down due to TERM signal")
39
48
  ensure
49
+ @on_stop.call(@offset) if @on_stop
50
+
40
51
  close
41
52
  end
42
53
 
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Kafka
3
- VERSION = "0.7.0"
3
+ VERSION = "0.8.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Climate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-30 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bson