In article <BAY13-F104AlWqfSp8O000356a4 / hotmail.com>,
Daniel Berger <djberg96 / hotmail.com> wrote:
>All,
>
>I am very happy to announce the release of win32-service 0.3.0. Thanks to
>the help of my fellow cohorts in crime, Park Heesob and Shashank Date, this
>module now provides code that allows you to run Ruby programs as a Win32
>Service!
>
>What is it?
>An interface for controlling and/or monitoring Win32 services. In addition,
>you can now run Ruby code as a service using the Daemon subclass.
>
>Where is it?
>You can find it on the RAA or at http://rubyforge.org/projects/win32utils/
>
>Sample Daemon code:
># (After installing the service)
># Write to a file every 10 seconds
>class Daemon
> def worker
> while state == RUNNING
> sleep 10
> f = File.open("c:\\test.log","a+")
> f.puts("service is running")
> f.close
> end
> end
>end
>
>d = Daemon.new
>d.mainloop
>
>You can find out more information by reading the included documentation.
>There is also a sample daemon script for you to play with.
>
>Note that this should be considered an ALPHA release (the Daemon portion,
>that is). We have great plans for this class, including hooks for signals,
>and whatever else we can dream up.
>
>Time for a shameless plug - if you're interested in following the
>development of this module and the other win32 utils packages, you can
>subscribe to the mailing list at
>http://rubyforge.org/mailman/listinfo/win32utils-devel. It's a moderated
>list, so no spam. :)
>
>Enjoy!
>
Cool.
Just an idea: What about some kind of cross-platform Sevices/Deamon
package so that code written with it can be run on either Windows or *nix
unchanged?That way the same interface could be used to write code like this
on any platform. When the module is required it could figure out the correct
implementation for the class' methods based on PLATFORM (on *nix fork
could be used, for example).
Phil