[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] win32-service 0.5.2

Daniel Berger

11/25/2006 6:08:00 PM

Hi all,

The Win32Utils Team is happy to announce the release of win32-service
0.5.2. Normally I don't announce minor releases, but this one contains
a fix for the dreaded thread blocking issue (you know, where you would
call Service.stop, and the your Daemon would just kinda hang).

Many thanks go to Patrick Hurley for his patch.

You can find it on the RAA (as win32-service) or on RubyForge (as part
of the win32utils project).

But wait! There are other goodies, too:

- I've added the Daemon#running? helper method for use within your
service_main code. So, your Daemon class should generally always look
something like this:

class Daemon
def service_main
while running?
if state == RUNNING # As opposed to IDLE or PAUSED
# Your loop here
else
sleep 1
end
end
end
end

- I've scrapped the old daemon example code in the 'example'
subdirectory (which didn't actually work) and replaced it with two
separate files - tdaemon.rb and tdaemon_ctl.rb. It's a simple service
that writes a short text message to your c:\ drive every 5 seconds.
Oh, and it actually works. :)

- There's now a gem (that we host). This is a C extension, so you'll
still need a C compiler to build and install the gem. If you don't
have a C compiler, you can download the shared object directly from the
project page at
http://rubyforge.org/frs/download.php/15016/service-0.....
Rename the file to just "service.so" and copy it manually to
c:\ruby\lib\ruby\1.8\i386-mswin32\win32.

That's it for now. Enjoy!

The Win32Utils Team