<div dir="ltr">Hi, I&#39;ve tried it both ways (:arg &amp; :args) and still get the same &#39;Client disconected&#39; in the debug log. I also tried simplifying the call to see if any of the arguments were the problem:<div>
<br></div><div>MiddleMan.worker(:danny_worker).async_do_work(:arg =&gt; &quot;<a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a>&quot;)</div><div><br></div><div>and I still get the error. It seems like the disconnect happens before it even reads anything in the worker file. I tried calling an argument that wasn&#39;t in the worker:</div>
<div><br></div><div>MiddleMan.worker(:danny_worker).async_should_not_work(:arg =&gt; &quot;<a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a>&quot;)</div><div><br></div><div>and simply got the &#39;Client disconected&#39; error.</div>
<div><br></div><div>Any ideas?</div><div><br></div><div>-gb<br><br><div class="gmail_quote">On Thu, Sep 18, 2008 at 12:22 PM, hemant <span dir="ltr">&lt;<a href="mailto:gethemant@gmail.com">gethemant@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">To pass arguments you use :arg not :args.<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
On Thu, Sep 18, 2008 at 11:22 PM, Grant Blakeman<br>
&lt;<a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a>&gt; wrote:<br>
&gt; Hi, I&#39;ve had a project using a really old version of backgroundrb (don&#39;t<br>
&gt; remember which one) to simply send out some e-mails in the background. I&#39;m<br>
&gt; currently trying to upgrade the project so that I can learn more about<br>
&gt; backgroundrb and use some of its other features.<br>
&gt; I&#39;ve tried rewriting my worker call to work with the latest version (see<br>
&gt; below), but every time I try it, the debug log simply prints &#39;Client<br>
&gt; disconected&#39; and nothing happens. Am I doing something wrong?<br>
&gt; In my controller:<br>
&gt; MiddleMan.worker(:david_worker).async_do_work(:args =&gt; { :email =&gt;<br>
&gt; @user.email,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :url =&gt; @user.reset_password_code,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :mail_type =&gt; :forgot_password_email })<br>
&gt; -------------------<br>
&gt; In my worker:<br>
&gt; &nbsp; set_worker_name :david_worker<br>
&gt;<br>
&gt; &nbsp; def create(args = nil)<br>
&gt; &nbsp; &nbsp; # this method is called, when worker is loaded for the first time<br>
&gt; &nbsp; end<br>
&gt;<br>
&gt; &nbsp; def do_work(args)<br>
&gt; &nbsp; &nbsp; Notifier.send(&quot;deliver_#{args[:mail_type]}&quot;, args)<br>
&gt; &nbsp; end<br>
&gt; Thanks in advance for any tips!<br>
&gt; --<br>
&gt; -Grant Blakeman<br>
&gt; <a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a><br>
&gt; <a href="http://grantblakeman.com" target="_blank">http://grantblakeman.com</a><br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Backgroundrb-devel mailing list<br>
&gt; <a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a><br>
&gt; <a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel" target="_blank">http://rubyforge.org/mailman/listinfo/backgroundrb-devel</a><br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Let them talk of their oriental summer climes of everlasting<br>
conservatories; give me the privilege of making my own summer with my<br>
own coals.<br>
<br>
<a href="http://gnufied.org" target="_blank">http://gnufied.org</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>-Grant Blakeman<br><a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a><br><a href="http://grantblakeman.com">http://grantblakeman.com</a><br>
</div></div>