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:
MiddleMan.worker(:danny_worker).async_do_work(:arg => "
[EMAIL PROTECTED]")
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:
MiddleMan.worker(:danny_worker).async_should_not_work(:arg => "
[EMAIL PROTECTED]")
and simply got the 'Client disconected' error.
Any ideas?
-gb
On Thu, Sep 18, 2008 at 12:22 PM, hemant <[EMAIL PROTECTED]> wrote:
> To pass arguments you use :arg not :args.
>
>
> On Thu, Sep 18, 2008 at 11:22 PM, Grant Blakeman
> <[EMAIL PROTECTED]> wrote:
> > 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.
> > 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?
> > In my controller:
> > MiddleMan.worker(:david_worker).async_do_work(:args => { :email =>
> > @user.email,
> > :url => @user.reset_password_code,
> > :mail_type => :forgot_password_email })
> > -------------------
> > In my worker:
> > set_worker_name :david_worker
> >
> > def create(args = nil)
> > # this method is called, when worker is loaded for the first time
> > end
> >
> > def do_work(args)
> > Notifier.send("deliver_#{args[:mail_type]}", args)
> > end
> > Thanks in advance for any tips!
> > --
> > -Grant Blakeman
> > [EMAIL PROTECTED]
> > http://grantblakeman.com
> >
> > _______________________________________________
> > Backgroundrb-devel mailing list
> > [email protected]
> > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
> >
>
>
>
> --
> Let them talk of their oriental summer climes of everlasting
> conservatories; give me the privilege of making my own summer with my
> own coals.
>
> http://gnufied.org
>
--
-Grant Blakeman
[EMAIL PROTECTED]
http://grantblakeman.com
_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel