Brian's Waste of Time

Sat, 22 Apr 2006

DRb over Unix Sockets

So, it is right in the docs, but somehow I overlooked it... You can do DRb over unix sockets dirt easily =)

require 'drb'

class Logger
  def log m
    puts m
  end
end

DRb.start_service "drbunix:///tmp/logger", Logger.new

Note the URI.

require 'drb'

DRb.start_service

logger = DRbObject.new_with_uri "drbunix:///tmp/logger"

logger.log "Woot!"

=)

2 writebacks [/src/ruby] permanent link