hot_bunnies 2.0.0.pre7-java → 2.0.0.pre8-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -102,12 +102,13 @@ module HotBunnies
102
102
  def initialize(channel, opts, callback, executor)
103
103
  super(channel, callback)
104
104
  @executor = executor
105
- @opts = opts
105
+ @executor_submit = executor.java_method(:submit, [JavaConcurrent::Runnable.java_class])
106
+ @opts = opts
106
107
  end
107
108
 
108
109
  def deliver(headers, message)
109
110
  unless @executor.shutdown?
110
- @executor.submit do
111
+ @executor_submit.call do
111
112
  begin
112
113
  callback(headers, message)
113
114
  rescue Exception => e
@@ -1,5 +1,6 @@
1
1
  module JavaConcurrent
2
2
  java_import 'java.lang.Thread'
3
+ java_import 'java.lang.Runnable'
3
4
  java_import 'java.lang.InterruptedException'
4
5
  java_import 'java.util.concurrent.Executors'
5
6
  java_import 'java.util.concurrent.LinkedBlockingQueue'
@@ -95,6 +95,17 @@ module HotBunnies
95
95
  @connection.heartbeat = n
96
96
  end
97
97
 
98
+ def start
99
+ # no-op
100
+ #
101
+ # This method mimics Bunny::Session#start in Bunny 0.9.
102
+ # Without it, #method_missing will proxy the call to com.rabbitmq.client.AMQConnection,
103
+ # which happens to have a #start method which is not idempotent.
104
+ #
105
+ # So we stub out #start in case someone migrating from Bunny forgets to remove
106
+ # the call to #start. MK.
107
+ end
108
+
98
109
  def method_missing(selector, *args)
99
110
  @connection.__send__(selector, *args)
100
111
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module HotBunnies
4
- VERSION = "2.0.0.pre7"
4
+ VERSION = "2.0.0.pre8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hot_bunnies
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre7
4
+ version: 2.0.0.pre8
5
5
  prerelease: 6
6
6
  platform: java
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-02 00:00:00.000000000 Z
13
+ date: 2013-07-04 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: RabbitMQ client for JRuby built around the official RabbitMQ Java client
16
16
  email: