<div dir="ltr"><span class="Apple-style-span" style="border-collapse: collapse; ">Hi, I've had a project using a really old version of backgroundrb (don't remember which one) to simply send out some e-mails in the background. I'm currently trying to upgrade the project so that I can learn more about backgroundrb and use some of its other features.<div>
<br></div><div>I've tried rewriting my worker call to work with the latest version (see below), but every time I try it, the debug log simply prints 'Client disconected' and nothing happens. Am I doing something wrong?</div>
<div><br></div><div>In my controller:</div><div><br></div><div><div>MiddleMan.worker(:david_worker).async_do_work(:args => { :email => @user.email,</div><div> :url => @user.reset_password_code,</div>
<div> :mail_type => :forgot_password_email })</div><div><br></div><div>-------------------</div><div><br></div><div>In my worker:</div><div><br></div><div><div> set_worker_name :david_worker</div>
<div> </div><div> def create(args = nil)</div><div> # this method is called, when worker is loaded for the first time</div><div> end</div><div> </div><div> def do_work(args)</div><div> Notifier.send("deliver_#{args[:mail_type]}", args)</div>
<div> end</div></div><div><br></div><div>Thanks in advance for any tips!</div></div></span><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>