Skip to content

Instantly share code, notes, and snippets.

@kballenegger
Created June 6, 2012 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kballenegger/0d1b9c71e8faa7ed2c96 to your computer and use it in GitHub Desktop.
Save kballenegger/0d1b9c71e8faa7ed2c96 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'bundler/setup'
if fork
# parent
require 'rack'
require 'kenji'
app = proc do |env|
Kenji::Kenji.new(env, File.dirname(__FILE__)).call
end
run app
else
# child
require 'eventmachine'
require File.dirname(__FILE__)+'/realtime/server.rb'
begin
EventMachine.run do
EventMachine.start_server '127.0.0.1', 8081, RealtimeServer
end
rescue Interrupt
puts '[REALTIME] shutting down real time eventmachine server'
exit
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment