Skip to content

Instantly share code, notes, and snippets.

View nicobrevin's full-sized avatar

Nick Griffiths nicobrevin

  • Catalyst NZ
  • Wellington, New Zealand
View GitHub Profile
public class JRubyDaemon implements Daemon {
private Ruby runtime;
private Thread thread;
private RubyModule appModule;
private boolean debug;
private RubyModule daemon;
public void init(DaemonContext arguments) throws Exception {
@nicobrevin
nicobrevin / gist:460263
Created July 1, 2010 17:26
jsvc-daemon
#! /bin/sh
# Generic script for running ruby scripts as daemons using
# jsvc and a java class to control the daemon.
#
# Contains common parameters and start/stop
# Things you'll need to set on a per script/daemon basis:
# SCRIPT_NAME
#
# Things you can set:
def MyClass
module Transactional
def delete_them
db.delete
end
end
# this looks for a transaction module, introspects the methods,
# adds new methods to MyClass which create transactions and then calls