Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 29 lines (22 sloc) 0.631 kB
5a0f6a6 @mnutt initial commit
authored
1 $LOAD_PATH.unshift(File.dirname(__FILE__))
2 $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
3
4 require 'app'
5 require 'em-websocket'
6 require 'evented_redis'
7 require 'thin'
8
9 EventMachine.run do
10 @channel = EM::Channel.new
11
12 redis = EventedRedis.connect
13 redis.subscribe('resque:publisher') do |type, channel, message|
14 @channel.push message
15 end
16
17 EventMachine::WebSocket.start(:host => '0.0.0.0', :port => 8080) do |ws|
18 ws.onopen do
19 sid = @channel.subscribe { |msg| ws.send msg }
20
21 ws.onclose do
22 @channel.unsubscribe(sid)
23 end
24 end
25 end
26
27 Resque::Server.run!({:port => 5679})
28 end
Something went wrong with that request. Please try again.