action_subscriber 5.2.3 → 5.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8ceaeb4042785bd8ea3ada6665612eb2e744234ef258211ef26a87dd2e78630
4
- data.tar.gz: '008e7aaae3c7d0ad58fdee940486eaf6a4f43fa55628edd8106da725c0158348'
3
+ metadata.gz: 75412f105d4ea0b12ab1edbd9fa3df950cf3e147e86fa21b242aff564fabc466
4
+ data.tar.gz: 5207dc013f9158c653c33e686e0109e4998af3b438c637c2ceecae61d470a6f4
5
5
  SHA512:
6
- metadata.gz: 7588e706731a7f2e1e8dbfb077f429ccc6a483dad80c93845063b01e13ea6a8d4c2ef667e96cec49de70062f3b7072cd36546e613be8be790e4afb401b2239c0
7
- data.tar.gz: e2906c4a77e5a2afadf697f8640d8cefb1e9bdcc04886073be044063212cb35eb956c39038106b199633b0defcfbd69fe43e2e72452f16b9667cceddce817666
6
+ metadata.gz: abecac37fca82cc001dc8f227591a48ea8018006e69a1be3e15f3f9231f7387294ee7060b933a516c990a171b66550d74276f08e987e813d4bb828583645fa61
7
+ data.tar.gz: af0e6d92683738dcc00f52c8edfd78fddd916b05f822eb94708573ab722f6b41bb554ece3fd4bd2a60b2f678183f574a1f3985dc96094c706d5e616534918c8f
@@ -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: ruby
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
  name: activesupport
@@ -299,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
299
  - !ruby/object:Gem::Version
300
300
  version: '0'
301
301
  requirements: []
302
- rubygems_version: 3.1.6
302
+ rubygems_version: 3.2.28
303
303
  signing_key:
304
304
  specification_version: 4
305
305
  summary: ActionSubscriber is a DSL that allows a rails app to consume messages from