module Slatan

Constants

VERSION

Public Class Methods

daemonize() click to toggle source
# File lib/slatan.rb, line 31
def daemonize
  begin
    Process.daemon

    File.open(Spirit.pid_file_path, 'w') do |f|
      f << Process.pid
    end
  rescue => e
    Buttocks.fatal "failed to daemonize slatan.(#{e.message})"
    exit
  end
end
run(options = {}) click to toggle source
running slatan

@param options

daemonize: running on daemon mode(default false)
# File lib/slatan.rb, line 14
def run(options = {})
  {
    daemonize: false
  }.merge(options)

  Buttocks.init

  @heart = Heart.new

  begin
    daemonize if options[:daemonize]
    @heart.beat
  rescue => e
    Buttocks.fatal "#{e.backtrace.first}: #{e.message} (#{e.class})"
  end
end