This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"RubyThread-33: my_code.rb:25" daemon prio=10 tid=0x00007fd08c968000 nid=0x8db in Object.wait() [0x00007fd067447000] | |
java.lang.Thread.State: WAITING (on object monitor) | |
at java.lang.Object.wait(Native Method) | |
- waiting on <0x00000000e4426ef8> (a org.jruby.ext.thread.Queue) | |
at java.lang.Object.wait(Object.java:461) | |
at org.jruby.RubyThread$SleepTask.run(RubyThread.java:906) | |
- locked <0x00000000e4426ef8> (a org.jruby.ext.thread.Queue) | |
at org.jruby.RubyThread.executeBlockingTask(RubyThread.java:922) | |
at org.jruby.RubyThread.wait_timeout(RubyThread.java:1225) | |
at org.jruby.ext.thread.Queue.pop(Queue.java:143) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Old school Java wait/notify | |
if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' | |
# Use Java wait/notify/notifyAll | |
require "java" | |
class Object | |
def wait | |
create_monitor unless @monitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bunny' | |
conn = Bunny.new | |
conn.start | |
channel = conn.create_channel | |
queue = channel.queue("app.work", :durable=>true) | |
# Create exchange for rpc response and bind to temp queue | |
conn.exchange("app_rpc_response", :type=>:direct) |