Thursday, May 24, 2007

Rails Support with Custom Daemons

presented by Tammer Saleh

Resources:

LDAP Server Code is available here:
http://thoughtbot.com/projects/ldap-ar-gateway

svn: http://svn.thoughtbot.com/ldap-activerecord-gateway

My Summary:

Whew! Don't be afraid to use daemon processes in Rails to do background tasks. Crib code from Tammer's site to do it!

My Notes:

Problem:

Rails app for recruiting company needed client-side integration (mail, address book, outlook)
They built LDAP to ActiveDirectory gateway (ruby-ldapserver gem)
returns results from the app db

daemon - btwn OS kernel and application, usually run in the background disconnected from a terminal

Logging:

Testing daemon processes:
use Mocking
set up the Kernel, etc. with a bunch of .expects and then daemonize
daemon will not actually run

daemonize as soon as possible in your code - anything you do before daemonizing is lost after daemonizing
rescue anything that could fail as you are cut off from the usual messaging
logger.debug with vigor

Interface with your data via
WebDAV file access
SNMP protocol for monitoring your network equipment
FTP
System Monitoring
ping other sites to see if they're running
long-running tasks (backgroundrb)
Interfacing with other apps through REST
FTP - Highrise
IRC - Campfire proxy

slides will be available on thoughtbot's main page

No comments: