<div dir="ltr">I'm having a problem where whenever I try to call a worker method, something blows up saying that the worker can't be found. In debugging my code, I can see that the worker was found and that the problem doesn't arrise until I attempt to call a method on it, async or not. My code looks like this:<br>
<br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">MiddleMan.new_worker(:worker => :geocode_worker, :worker_key => "123")</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sleep(1) # OSX hack!</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">geocode_worker = MiddleMan.worker(:geocode_worker, :worker_key => "123")</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">geocode_worker.async_geocode_address(:arg => data)</span><br></div><br>Querying the geocode_worker in the debugger, I get:<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">#<BackgrounDRb::RailsWorkerProxy:0x261c9dc @middle_man=#<BackgrounDRb::ClusterConnection:0x2205ad8 @request_count=2, @bdrb_servers=[#<struct #<Class:0x2205a24> ip="<a href="http://127.0.0.1">127.0.0.1</a>", port=11006>], @round_robin=[0], @last_polled_time=Wed Sep 10 13:58:03 +0000 2008, @disconnected_connections={}, @backend_connections=[#<BackgrounDRb::Connection:0x22057f4 @server_ip="<a href="http://127.0.0.1">127.0.0.1</a>", @connection_status=true, @connection=nil, @cluster_conn=#<BackgrounDRb::ClusterConnection:0x2205ad8 ...>, @server_port=11006, @mutex=#<Mutex:0x22057cc>>]>, @worker_name=:geocode_worker, @tried_connections=[], @worker_key={:worker_key=>"123"}></span><br>
</div><br>So it would seem that the worker was found, and it has the proper name and worker_key. But when I call async_geocode_address on the worker, I see this in the backgroundrb log:<br><br><div style="margin-left: 40px;">
<span style="font-family: courier new,monospace;">Invalid worker with name geocode_worker_worker_key123 and key worker_key123</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_connection.rb:52:in `ask_worker'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/Users/brent/near-time/near-time.net-exp-rescue-princexml-5504/vendor/plugins/backgroundrb/server/lib/master_worker.rb:140:in `method_invoke'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/Users/brent/near-time/near-time.net-exp-rescue-princexml-5504/vendor/plugins/backgroundrb/server/lib/master_worker.rb:41:in `receive_data'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_parser.rb:44:in `extract'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_parser.rb:26:in `loop'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_parser.rb:26:in `extract'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/Users/brent/near-time/near-time.net-exp-rescue-princexml-5504/vendor/plugins/backgroundrb/server/lib/master_worker.rb:32:in `receive_data'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:230:in `read_external_socket'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:222:in `handle_external_messages'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:196:in `handle_read_event'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:192:in `each'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:192:in `handle_read_event'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:146:in `start_reactor'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:139:in `loop'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:139:in `start_reactor'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_master.rb:21:in `run'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/Users/brent/near-time/near-time.net-exp-rescue-princexml-5504/vendor/plugins/backgroundrb/server/lib/master_proxy.rb:14:in `initialize'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">script/backgroundrb:46:in `new'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">script/backgroundrb:46</span><br>
</div><br>What's up with that first line? The worker name and key are both totally wrong, and I'm not sure why. Does anybody have any idea what's going on here?<br><br>FYI, I'm on the lates Git code as of a couple of days ago and Packet v0.1.13.<br>
<br>-Brent<br><br><br clear="all"><br>-- <br>Brent Collier | <a href="http://www.BrentCollier.com">www.BrentCollier.com</a> | <a href="http://www.acts-as-blogr.com">www.acts-as-blogr.com</a><br>
</div>