<div dir="ltr">I&#39;m having a problem where whenever I try to call a worker method, something blows up saying that the worker can&#39;t be found.&nbsp; In debugging my code, I can see that the worker was found and that the problem doesn&#39;t arrise until I attempt to call a method on it, async or not.&nbsp; My code looks like this:<br>
<br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">MiddleMan.new_worker(:worker =&gt; :geocode_worker, :worker_key =&gt; &quot;123&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sleep(1)&nbsp; # 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 =&gt; &quot;123&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">geocode_worker.async_geocode_address(:arg =&gt; 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;">#&lt;BackgrounDRb::RailsWorkerProxy:0x261c9dc @middle_man=#&lt;BackgrounDRb::ClusterConnection:0x2205ad8 @request_count=2, @bdrb_servers=[#&lt;struct #&lt;Class:0x2205a24&gt; ip=&quot;<a href="http://127.0.0.1">127.0.0.1</a>&quot;, port=11006&gt;], @round_robin=[0], @last_polled_time=Wed Sep 10 13:58:03 +0000 2008, @disconnected_connections={}, @backend_connections=[#&lt;BackgrounDRb::Connection:0x22057f4 @server_ip=&quot;<a href="http://127.0.0.1">127.0.0.1</a>&quot;, @connection_status=true, @connection=nil, @cluster_conn=#&lt;BackgrounDRb::ClusterConnection:0x2205ad8 ...&gt;, @server_port=11006, @mutex=#&lt;Mutex:0x22057cc&gt;&gt;]&gt;, @worker_name=:geocode_worker, @tried_connections=[], @worker_key={:worker_key=&gt;&quot;123&quot;}&gt;</span><br>
</div><br>So it would seem that the worker was found, and it has the proper name and worker_key.&nbsp; 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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</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&#39;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">script/backgroundrb:46:in `new&#39;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">script/backgroundrb:46</span><br>
</div><br>What&#39;s up with that first line?&nbsp; The worker name and key are both totally wrong, and I&#39;m not sure why.&nbsp; Does anybody have any idea what&#39;s going on here?<br><br>FYI, I&#39;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>