bunny 1.6.1 → 1.6.2

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
  SHA1:
3
- metadata.gz: 65fac851747ba831f48433378fbe43ddfb96c57a
4
- data.tar.gz: 3065bffd94f02c19738ea1352f238c223f8f5f90
3
+ metadata.gz: 09f980320596ae3eead897e92cb66d74c632a257
4
+ data.tar.gz: 6b3b92232fdced1f96c90d452136b3f46e1f6a42
5
5
  SHA512:
6
- metadata.gz: 78bc0ff879a3d2d94b1f97c55dfb1524cfed7dce6ad37d8c7a32d442de9f2b547df3c05fc243e103c01a5c50558b6fafc7a8b2f7c56c62b6f3c942e42398ad31
7
- data.tar.gz: 8aff7680586499e05cadf62da282b08b6866829e468c6aee4126a0da31de6773af93ed7299f36eab2e64c6f0d417b5a0a11984419f92835df6d66aec5f704f22
6
+ metadata.gz: 45314827e8cb6c002b78699925f78c07e68222ad3c7d7ff3bec9ccad9160285fd9a0bbbbac820acf8b54f11ce52671578b1c8f554db27233341784c65f399100
7
+ data.tar.gz: 303c9cee35b6ca65a1e15ce15cbaded1b82564b9749dba146da44f02f1bed7e7bc0564754ac6e00d619e7c06307d45d85a9908ccefce34d23272a1ab3aed99bb
@@ -1,3 +1,15 @@
1
+ ## Changes between Bunny 1.6.1 and 1.6.2
2
+
3
+ ### JRuby Writes Fixes
4
+
5
+ On JRuby, Bunny reverts back to using plain old `write(2)` for writes. The CRuby implementation
6
+ on JRuby suffers from I/O incompatibilities. Until JRuby
7
+
8
+ Bunny users who run on JRuby are highly recommended to switch to [March Hare](http://rubymarchhare.info),
9
+ which has nearly identical API and is significantly more efficient.
10
+
11
+
12
+
1
13
  ## Changes between Bunny 1.6.0 and 1.6.1
2
14
 
3
15
  ### Bunny::Session#with_channel Synchornisation Improvements
@@ -101,28 +101,51 @@ module Bunny
101
101
  block.call(@tls_context) if @tls_context
102
102
  end
103
103
 
104
- # Writes data to the socket. If read/write timeout was specified the operation will return after that
105
- # amount of time has elapsed waiting for the socket.
106
- #
107
- # @raise [ClientTimeout]
108
- def write(data)
109
- return write_without_timeout(data) unless @write_timeout
110
-
111
- begin
112
- if open?
113
- @writes_mutex.synchronize do
114
- @socket.write_nonblock_fully(data, @write_timeout)
104
+ if defined?(JRUBY_VERSION)
105
+ # Writes data to the socket.
106
+ def write(data)
107
+ return write_without_timeout(data) unless @write_timeout
108
+
109
+ begin
110
+ if open?
111
+ @writes_mutex.synchronize do
112
+ @socket.write(data)
113
+ end
114
+ end
115
+ rescue SystemCallError, Timeout::Error, Bunny::ConnectionError, IOError => e
116
+ @logger.error "Got an exception when sending data: #{e.message} (#{e.class.name})"
117
+ close
118
+ @status = :not_connected
119
+
120
+ if @session.automatically_recover?
121
+ @session.handle_network_failure(e)
122
+ else
123
+ @session_thread.raise(Bunny::NetworkFailure.new("detected a network failure: #{e.message}", e))
115
124
  end
116
125
  end
117
- rescue SystemCallError, Timeout::Error, Bunny::ConnectionError, IOError => e
118
- @logger.error "Got an exception when sending data: #{e.message} (#{e.class.name})"
119
- close
120
- @status = :not_connected
121
-
122
- if @session.automatically_recover?
123
- @session.handle_network_failure(e)
124
- else
125
- @session_thread.raise(Bunny::NetworkFailure.new("detected a network failure: #{e.message}", e))
126
+ end
127
+ else
128
+ # Writes data to the socket. If read/write timeout was specified the operation will return after that
129
+ # amount of time has elapsed waiting for the socket.
130
+ def write(data)
131
+ return write_without_timeout(data) unless @write_timeout
132
+
133
+ begin
134
+ if open?
135
+ @writes_mutex.synchronize do
136
+ @socket.write_nonblock_fully(data, @write_timeout)
137
+ end
138
+ end
139
+ rescue SystemCallError, Timeout::Error, Bunny::ConnectionError, IOError => e
140
+ @logger.error "Got an exception when sending data: #{e.message} (#{e.class.name})"
141
+ close
142
+ @status = :not_connected
143
+
144
+ if @session.automatically_recover?
145
+ @session.handle_network_failure(e)
146
+ else
147
+ @session_thread.raise(Bunny::NetworkFailure.new("detected a network failure: #{e.message}", e))
148
+ end
126
149
  end
127
150
  end
128
151
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "1.6.1"
5
+ VERSION = "1.6.2"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-11-06 00:00:00.000000000 Z
15
+ date: 2014-11-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol