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 +4 -4
- data/README.md +18 -0
- data/lib/bunny_exchanges/version.rb +1 -1
- data/lib/bunny_exchanges.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e65427261ca8ffce3f3c5a6f848e5a104ec410cc
|
4
|
+
data.tar.gz: b308f7271cf13be7e4c8c562332cab2a8fd5df23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 )
|
data/lib/bunny_exchanges.rb
CHANGED
@@ -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
|
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-
|
11
|
+
date: 2016-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|