<div dir="ltr">Hi, I've tried it both ways (:arg & :args) and still get the same 'Client disconected' 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 => "<a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a>")</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't in the worker:</div>
<div><br></div><div>MiddleMan.worker(:danny_worker).async_should_not_work(:arg => "<a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a>")</div><div><br></div><div>and simply got the 'Client disconected' 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"><<a href="mailto:gethemant@gmail.com">gethemant@gmail.com</a>></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>
<<a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a>> wrote:<br>
> Hi, I've had a project using a really old version of backgroundrb (don't<br>
> remember which one) to simply send out some e-mails in the background. I'm<br>
> currently trying to upgrade the project so that I can learn more about<br>
> backgroundrb and use some of its other features.<br>
> I've tried rewriting my worker call to work with the latest version (see<br>
> below), but every time I try it, the debug log simply prints 'Client<br>
> disconected' and nothing happens. Am I doing something wrong?<br>
> In my controller:<br>
> MiddleMan.worker(:david_worker).async_do_work(:args => { :email =><br>
> @user.email,<br>
> :url => @user.reset_password_code,<br>
> :mail_type => :forgot_password_email })<br>
> -------------------<br>
> In my worker:<br>
> set_worker_name :david_worker<br>
><br>
> def create(args = nil)<br>
> # this method is called, when worker is loaded for the first time<br>
> end<br>
><br>
> def do_work(args)<br>
> Notifier.send("deliver_#{args[:mail_type]}", args)<br>
> end<br>
> Thanks in advance for any tips!<br>
> --<br>
> -Grant Blakeman<br>
> <a href="mailto:grant.blakeman@gmail.com">grant.blakeman@gmail.com</a><br>
> <a href="http://grantblakeman.com" target="_blank">http://grantblakeman.com</a><br>
><br>
</div></div>> _______________________________________________<br>
> Backgroundrb-devel mailing list<br>
> <a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a><br>
> <a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel" target="_blank">http://rubyforge.org/mailman/listinfo/backgroundrb-devel</a><br>
><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>