action_subscriber 5.2.3-java → 5.2.4-java

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: 70428c30ef852da7b3e5678f2e9bbf43dbaaac46a0280a865e9aa314efb43fc3
4
- data.tar.gz: 67d69b8f403eba527f180e9c0ea7d5eb49faabfe2adc91f8e42c192d4600e97c
3
+ metadata.gz: b3c149733cfa1c38c096b3e1c9b69662c707d4fc1ead5285f62c3ff95589cf63
4
+ data.tar.gz: 46ad0ff7ab7ccd891f91376d25fe203c0bedac121ec438210d51c232af8e83b2
5
5
  SHA512:
6
- metadata.gz: 1eb8b21638811db8325eb6ccf27091aef00d9394324b2e46c41ce2ef2dfa3ac90be2a4b4e448afc8d910e0325e37e033b5fa071cb1545fdae28fb5e264dc2527
7
- data.tar.gz: c3895c215507a1e61712ef071cf96ce4dfaca092df3172d044c3a97933970dd317260bac8c9aef791efb52f58cbdc027521fee07365a2254b8d08dd049ea6f53
6
+ metadata.gz: b8525aae6c072fd7411b54cebef73631acdebfd910fa644d488ef8e11031532fe64748172c180874defc27e711773dc9fbf9e958ab58ca96d795ddb9d154ae92
7
+ data.tar.gz: f5cd2b516b63013eb6697caa94abe6f0394012dd9e7e8e1426ef8f70d38bdef2bfbd57abb760dfc7385cbade43cb5f49dd3c894aae5a5bb633942d9f12e4686f
@@ -1,3 +1,5 @@
1
+ require "active_support/notifications"
2
+
1
3
  module ActionSubscriber
2
4
  module Babou
3
5
  ##
@@ -10,7 +12,7 @@ module ActionSubscriber
10
12
  ::ActionSubscriber.print_subscriptions
11
13
  ::ActionSubscriber.start_subscribers!
12
14
  logger.info "Action Subscriber connected"
13
-
15
+ ::ActiveSupport::Notifications.instrument("action_subscriber:server_started")
14
16
  while true
15
17
  sleep 1.0 #just hang around waiting for messages
16
18
  break if shutting_down?
@@ -21,6 +23,7 @@ module ActionSubscriber
21
23
  logger.info "Shutting down"
22
24
  ::ActionSubscriber::RabbitConnection.subscriber_disconnect!
23
25
  logger.info "Shutdown complete"
26
+ ::ActiveSupport::Notifications.instrument("action_subscriber:server_stopped")
24
27
  exit(0)
25
28
  end
26
29
 
@@ -1,3 +1,3 @@
1
1
  module ActionSubscriber
2
- VERSION = "5.2.3"
2
+ VERSION = "5.2.4"
3
3
  end
@@ -87,6 +87,18 @@ module ActionSubscriber
87
87
  route_set.wait_to_finish_with_timeout(timeout)
88
88
  end
89
89
 
90
+ def self.after_server_start(&block)
91
+ ::ActiveSupport::Notifications.subscribe("action_subscriber:server_started") do |*args|
92
+ block.call(*args)
93
+ end
94
+ end
95
+
96
+ def self.after_server_stop(&block)
97
+ ::ActiveSupport::Notifications.subscribe("action_subscriber:server_stopped") do |*args|
98
+ block.call(*args)
99
+ end
100
+ end
101
+
90
102
  # Execution is delayed until after app loads when used with bin/action_subscriber
91
103
  require "action_subscriber/railtie" if defined?(Rails)
92
104
  ::ActiveSupport.run_load_hooks(:action_subscriber, Base)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_subscriber
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.3
4
+ version: 5.2.4
5
5
  platform: java
6
6
  authors:
7
7
  - Brian Stien
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2021-10-05 00:00:00.000000000 Z
15
+ date: 2022-01-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  requirement: !ruby/object:Gem::Requirement