keradgames / robinhood

Robin hood leverages celluloid actors to distribute long-lived processes across multiple servers using redis as a locking mechanism.
MIT License
0 stars 0 forks source link

Robinhood should have an executable #1

Open josepjaume opened 10 years ago

josepjaume commented 10 years ago

We should leverage the usage of the daemons gem to create a binary for robinhood that automatically loads the configuration from a Robinhood file and starts robinhood. Something like this would tentatively work:


#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
require 'fileutils'

options = {
  dir_mode: :normal,
  monitor: true,
  multiple: true,
  app_name: 'robinhood',
  log_output: true
}

Daemons.run_proc('robinhood', options) do
  require 'Robinhood'
  Robinhood.start!
end
josepjaume commented 10 years ago

Remember we should think about being able to specify a pids dir from the ENV when calling the executable:

PIDS_DIR=tmp/pids/robinhood LOGFILE=log/robinhood.log robinhood start