Hi, All<br><br>It appears that when you enque a task, backgroundrb doesn't pass the "arg" parameter when running the enqued method.<br><br>This is my worker:<br><br>class NotificationWorker < BackgrounDRb::MetaWorker<br>
set_worker_name :notification_worker<br><br> def create(args = nil)<br> <a href="http://logger.info">logger.info</a>("Args: #{args}")<br> end<br><br> def send_warranty_notice(data)<br> <a href="http://logger.info">logger.info</a> "Sending warranty notice id is #{data}"<br>
end<br>end<br><br>Here's how I call it from IRB<br><br>MiddleMan.worker(:notification_worker).enq_send_warranty_notice(:arg=>"asdf",:job_key=>Time.now.to_s,:scheduled_at => Time.now + 3.seconds)<br>
<br>The "send_warranty_notice" method gets called but the parameter passed (data) is nil.<br><br><br>Calling async_method works fine:<br><br>MiddleMan.worker(:notification_worker).async_send_warranty_notice(:arg=>"asdf")<br>
<br>prints out "Sending warranty notice id is asdf" in the drb log.<br><br>Also I noticed that on the following page <a href="http://backgroundrb.rubyforge.org/workers/">http://backgroundrb.rubyforge.org/workers/</a> the following text <br>
<pre class="boxed">MiddleMan(:hello_worker).enq_some_task(:arg => "hello_world",:job_key => "boy")<br><br>should read<br><br>MiddleMan.worker(:hello_worker).enq_some_task(:arg => "hello_world",:job_key => "boy") ... unless I am missing something?<br>
<br><br>Any suggestions on how I can fix the arg passing problem?<br><br><br>Regards<br>Justin Wood<br><br><br><br></pre><br><br><br>