bunny_exchanges_manager 0.0.1 → 0.1.0

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
  SHA1:
3
- metadata.gz: faca8ad660523c11f6eaac9717e1dcbc6fdc8c3b
4
- data.tar.gz: 6d83b196164c1d72d18eb74566c4ef2e75d4be69
3
+ metadata.gz: e65427261ca8ffce3f3c5a6f848e5a104ec410cc
4
+ data.tar.gz: b308f7271cf13be7e4c8c562332cab2a8fd5df23
5
5
  SHA512:
6
- metadata.gz: 857cba4b80f663d1a3e7eb344456de7cea463b78a5135249247edf3b75706ef39877c83bb89db5eb13f65526da047e0e9f71d582d5c8b8e2ad38edaa0f546c21
7
- data.tar.gz: 672c90b51c55a8da17838b9023e8f3a40c0f0c0353b90d34e4740bcd1377990859d6d6019e8a262040d211578498390806a2571b9fff6194649124d9a0592856
6
+ metadata.gz: cb2c99134815def9738a0abf645466bcc488fa44ee805e70d1ba1f47ad2c9e337f596d42e71b59633dd7365ecd0432cde1712ba0fd3db7f5122336724b7f0f4b
7
+ data.tar.gz: 5d08b1a43a2530822b5f6723ceee410d6276100840d29229f67d28cab4b8f82d4c1c1945d2329b2cc3f596f89323a7d1697dd3ddaf115f6d5675de8e60d27c35
data/README.md CHANGED
@@ -55,6 +55,24 @@ To get a configured exchange:
55
55
  BunnyExchanges.get(:an_action) # => #<Bunny::Exchange:...>
56
56
  ```
57
57
 
58
+ ### Pre-forking servers
59
+
60
+ There are situations when you need to reconnect to your AMQP server.
61
+ A common case is when you use BunnyExchanges with pre-forking servers like
62
+ PhussionPassenger or Unicorn.
63
+ For those situations a `BunnyExchanges.reset!` method is provided.
64
+
65
+ The following example shows how to reset your connection after a fork on
66
+ PhussionPassenger.
67
+ ```ruby
68
+ if defined?(PhusionPassenger)
69
+ PhusionPassenger.on_event(:starting_worker_process) do |forked|
70
+ BunnyExchanges.reset! if forked
71
+ end
72
+ end
73
+
74
+ ```
75
+
58
76
  ## Contributing
59
77
 
60
78
  1. Fork it ( https://github.com/[my-github-username]/bunny_exchanges_manager/fork )
@@ -1,3 +1,3 @@
1
1
  module BunnyExchanges
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -29,6 +29,12 @@ module BunnyExchanges
29
29
  manager.get(action)
30
30
  end
31
31
 
32
+ # Removes the current manager and starts a new one with the same configuration.
33
+ # Useful after forking or in any situation where a reconnection is needed.
34
+ def self.reset!
35
+ @manager = nil
36
+ end
37
+
32
38
  # The current instance of {BunnyExchanges::Manager}.
33
39
  #
34
40
  # @return [BunnyExchanges::Manager] the manager with the current configuration.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny_exchanges_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jcabotc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny