# Ruby/Watchcat 1.0.2 and Ruby/Watchcat-pure 1.1.0

**URL:** <https://www.ruby-forum.com/t/ruby-watchcat-1-0-2-and-ruby-watchcat-pure-1-1-0/147259>\
**Category:** Ruby\
**Created:** [August 29, 2008, 10:04pm UTC](https://www.ruby-forum.com/t/ruby-watchcat-1-0-2-and-ruby-watchcat-pure-1-1-0/147259 "2008-08-29T22:04:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![reflex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@reflex](https://www.ruby-forum.com/u/reflex)\
**Post date:** [August 29, 2008, 10:04pm UTC](https://www.ruby-forum.com/t/ruby-watchcat-1-0-2-and-ruby-watchcat-pure-1-1-0/147259/1 "2008-08-29T22:04:57Z")

</div>

Hello

I’m pleased to announce new releases of Ruby/Watchcat. The new  
ruby-watchcat-pure version adds FreeBSD support (tested on i386 and  
amd64) to Ruby/Watchcat. The C extension automatically supports FreeBSD  
if you install libwcat 1.1. The new release of the C extension features  
only a documentation update. Note that for FreeBSD support you also need  
to be running watchcatd 1.2.

For more details, please refer to the README file in the distribution  
and in the project’s homepage at

[http://oss.digirati.com.br/ruby-watchcat/](http://oss.digirati.com.br/ruby-watchcat/)

Ruby/Watchcat is an extension for Ruby for the development of  
watchcatd-aware applications.

Watchcatd is a watchdog-like daemon in the sense that it takes actions  
in situations where a machine is under heavy load and/or unresponsive.  
However, watchcatd isn’t as drastic as the usual watchdog systems, which  
reboot the machine. Instead, all it does is sending a signal to a  
registered process (which by default is SIGKILL) if the process doesn’t  
send it a heartbeat before a user-specified timeout.

Ruby/Watchcatd allows you to register ruby applications with watchcatd.

Install it with

gem install ruby-watchcat

or

gem install ruby-watchcat-pure

Examples:

require ‘watchcat’

# Create a new cat.

cat = Watchcat.new(:timeout =\> 10, :signal =\> ‘KILL’,  
:info =\> ‘killing from ruby’)  
loop do  
# Here you do something that could exceed the timeout  
sleep 9 + rand(3)  
cat.heartbeat # we’re still alive  
end  
cat.close # clean the cat’s litter box

You can also use a block, in which case the cat cleans its own litter  
box:

require ‘watchcat’

Watchcat.new do |cat|  
loop do  
do\_something\_that\_can\_be\_slow  
cat.heartbeat  
end  
end

Best regards,  
Andre N.
