BackgrounDRb and win32 Changes?

Group / Ezra,

I questioned if I should post this to this forum or not, but thought it
may be beneficial for other users who may encounter the same issue as
myself.

Two things:

  1. For some reason, I couldn’t get the backgroundrb win32 service to
    install without making a slight change to the backgroundrb/service file.
    I added the following:

require ‘rubygems’

This allowed for the service to install properly. Prior to that I was
getting an error from line 7 - require ‘win32/service’

I also had to add that line to the win32daemon file for the same reason.
I can’t imagine that I’m the only user on Windows using the service - so
if someone can help me understand why I had to modify those files for it
work in my environment then I would greatly appreciate it!

  1. Even though the service installed, it would not start! This is
    because the service is expecting ruby in a specific location:
    c:\ruby\bin\ruby.exe

(yes, it tells you that right after you install the service in the
command window)

If you are like me, you may not have ruby installed in that location! I
use instantrails on my development machine and would prefer to keep my
structure intact. You can modify the service file mentioned above (or
go into the registry and modify the path) to point to the actual path of
your ruby.exe. If registry, use following:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\BackgroundDRb\ImagePath

Any input on why I had these problems is greatly appreciated. If they
are legit issues, then hopefully Ezra can incorporate this into the
readme and/or the source files.

Regards,

Michael

Hey Michael-

Thanks for the feedback. I personally don't have a win32 box to test

any of this stuff on and the win32 stuff was a user submitted patch
so I’m sorry you had troubles with it. I think that the require
rubygems problem probably doesn’t show up because the ruby one click
installer sets the RUBYOPT env var to -rubygems which automatically
requires rubygems without you needing to do it yourself.

I will add a note about this to the readme and add a require

‘rubygems’ to the service files.

Thanks
-Ezra

Hi Ezra,

Please, do not apologize!!! I just wanted to give feedback on what I
encountered. This looks very promising and I hope my feedback can be
useful.

Over the course of the next few days I will be incorporating this into
my application to fix a few serious issues I have with long running
tasks. For example, I have an action that creates a pdf, attaches it to
an email and then sends the email. For some of my remote users this
gets done a few times by accident (meaning they invoke the action and
for some reason the action is executed multiple times). I believe this
is due to slow response time and browser retry but I don’t know for
sure. I do know the user isn’t attempting the action multiple times via
a gui action. It’s causing problems in my app though and I hope
BackgrounDRb will help me fix it.

I definitely will need some sort of interface where I can look at the
invoked tasks and see the result of that task. In your samples, you
show some ajax stuff that sends feedback to the client (if desired). In
some of my use cases, I don’t want (or need) the client to see what the
result is. Instead, I want a management interface where I can go in and
see the result of each of the invoked tasks.

Do you have anything like this yet? If not, then I’ll probably create a
new table to log all the requests. Then, as a request completes
(successfully or otherwise) I’ll log the result. From that table, if I
have a failed task, I will go and “restart it” after I have diagnosed
the root cause. If you have a code like this already then please share!
:slight_smile: If not, then I will be able to provide something soon and if you
want it you can have it.

Also, I notice that you have a basic timing mechanism (like repeat task
every xx interval). I would love to get rid of my scheduled tasks that
run via Windows Scheduler and hope that this will do the trick. I want
specified times though so I may make a few changes to the code. For
example, while it is true that I want a task to run once every 12 hours,
I want it to only be started at 6:00 am and 6:00 pm! If I stop and
restart the service for some reason in the middle of the day, I don’t
want that task to kickstart itself and then be off schedule!

You also mention wanting more samples and one of them being an email
example. If you give me the requirements then I may be able to put that
together for you as that’s what I’m tackling at the moment (outbound
emails). I also import emails every 15 minutes from an email account
and will be replacing my scheduled task with BackgrounDRb - so I should
be able to have both send and receive covered for you if the
requirements match closely enough to mine.

Let me know if I can help. Further, if you have issues that need
investigating on Windows then don’t hesitate to email me. I don’t check
the email account regularly that I use for this mailing list but if you
email to mmodica at cox dot net then I’ll get it and help.

Regards,

Michael

Hi~

On Aug 24, 2006, at 12:13 AM, Michael M. wrote:

it to
I definitely will need some sort of interface where I can look at the
create a
task

Let me know if I can help. Further, if you have issues that need
investigating on Windows then don’t hesitate to email me. I don’t
check
the email account regularly that I use for this mailing list but if
you
email to mmodica at cox dot net then I’ll get it and help.

Regards,

Michael

Hey Michael-

I am working on a stats add on for the plugin that will allow you to

have an admin view of all active workers and their state. I might
possibly add a simple model to track these results but I am not sure
if I want to make it depend on a database just yet. I’ll think about
it some more.

If you plan on using the plugin a bit then please come join the

mailing list for it, it is fairly active and its a better place to
ask questions about the plugin. The mailing list sign up address is
in the readme.

Cheers-
-Ezra