hanami-events-cloud_pubsub 3.0.5 → 3.0.6

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
  SHA256:
3
- metadata.gz: 3d44039a04524e3577341b8dce78ee4479b24b49972d9be9e5353ac8e1186b4c
4
- data.tar.gz: 84546314a907e147de4fbbcce02ec85e802c089e7ec2ed5b242e76bc53b63839
3
+ metadata.gz: 0c771a179c93a8264e30f783a31b3c623c301206c587f9fb76f3dfcff9834731
4
+ data.tar.gz: 6b4b4ec5bbef668fc5fdf3d46a336a1646a440eeaeb68825803211dc6797ac34
5
5
  SHA512:
6
- metadata.gz: 63555a20d775ee80b5841991b4a2e3176d63e55e447f318a3ffed81f115790ba7e9149c1a170c2fc53b5f03d26dcbd3de679b7c513074213495f193b2960d19f
7
- data.tar.gz: 3a21d8e97f431bca8b24cbffb2f09428cc743ff68f85225a0b71435f20196583e390e39c42bf6f1c9d425504ca9324b28310807bb631ddc8caed86a494a22960
6
+ metadata.gz: dd9fdb68cd1a9bfffadd5a55e3656c39e884dfa99f57324dba5b2609309c3077e8a83ed6d9bfe169dd5cf4ead82ab1fbe38c057ac889ae099f7f54aad8304aa0
7
+ data.tar.gz: 339896e5b18a3396f6988c19b846f6995d1fc3368b5430ff25c5ef5a759c9beac1609715aa2221ce03ea7470c3f769a4b8035a6fdb1198dd420fb4d619ba432f
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- hanami-events-cloud_pubsub (3.0.5)
11
+ hanami-events-cloud_pubsub (3.0.6)
12
12
  dry-configurable (>= 0.8)
13
13
  gapic-common (>= 0.3.4)
14
14
  google-cloud-pubsub (>= 0.38.1, < 2.4)
@@ -59,7 +59,8 @@ module Hanami
59
59
  end
60
60
 
61
61
  def shutdown
62
- subscriber.stop.wait!
62
+ stop
63
+ wait
63
64
  self
64
65
  end
65
66
 
@@ -68,8 +69,8 @@ module Hanami
68
69
  self
69
70
  end
70
71
 
71
- def wait
72
- subscriber.wait!
72
+ def wait(timeout = 60)
73
+ subscriber.wait!(timeout)
73
74
  self
74
75
  end
75
76
 
@@ -9,7 +9,7 @@ module Hanami
9
9
  class Runner
10
10
  attr_reader :logger, :adapter
11
11
 
12
- def initialize(adapter:, logger:, sleep_time: 2)
12
+ def initialize(adapter:, logger:, sleep_time: 30)
13
13
  @logger = logger
14
14
  @adapter = adapter
15
15
  @sleep_time = sleep_time
@@ -40,9 +40,8 @@ module Hanami
40
40
  def gracefully_shutdown
41
41
  stop
42
42
  logger.info "Gracefully shutting down CloudPubsub runner: #{self}"
43
- sleep_for_a_bit
43
+ adapter.listeners.each { |l| l.wait(@sleep_time) }
44
44
  adapter.flush_messages
45
- adapter.listeners.each(&:wait)
46
45
  handle_on_shutdown
47
46
 
48
47
  self
@@ -102,10 +101,6 @@ module Hanami
102
101
  MSG
103
102
  end
104
103
 
105
- def sleep_for_a_bit
106
- sleep @sleep_time
107
- end
108
-
109
104
  def handle_on_shutdown
110
105
  return if CloudPubsub.on_shutdown_handlers.empty?
111
106
 
@@ -3,7 +3,7 @@
3
3
  module Hanami
4
4
  module Events
5
5
  module CloudPubsub
6
- VERSION = '3.0.5'
6
+ VERSION = '3.0.6'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-events-cloud_pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-08 00:00:00.000000000 Z
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable