vrfs 192: added max_reconnect_time variable; added aasm/thin gems; integrated connection.aasm_state into participant REST

This commit is contained in:
Jonathan Kolyer 2013-02-06 07:00:51 -06:00
parent 9375c036f5
commit cd16c76f56
6 changed files with 11 additions and 4 deletions

View File

@ -11,6 +11,7 @@ if devenv
gem 'jampb', :path => "#{workspace}/jam-pb/target/ruby/jampb"
gem 'jam_ruby', :path => "#{workspace}/jam-ruby"
gem 'jam_websockets', :path => "#{workspace}/websocket-gateway"
gem 'thin'
else
gem 'jam_db'
gem 'jampb'
@ -43,6 +44,7 @@ gem 'sendgrid', '1.1.0'
gem 'recaptcha', '0.3.4'
gem 'filepicker-rails', '0.0.2'
gem 'aws-sdk', '1.8.0'
gem 'aasm', '3.0.16'
#group :libv8 do
# gem 'libv8', "~> 3.11.8"

View File

@ -1,6 +1,8 @@
object @connection
attributes :ip_address, :client_id
attribute :aasm_state => :connection_state
node(:user_id, :if => lambda { |connection| connection.user.friends?(current_user) }) do |connection|
connection.user_id
end

View File

@ -11,7 +11,7 @@ child(:connections => :participants) {
attributes :ip_address, :client_id
node :user do |connection|
{ :id => connection.user.id, :photo_url => connection.user.photo_url, :name => connection.user.name, :is_friend => connection.user.friends?(current_user) }
{ :id => connection.user.id, :photo_url => connection.user.photo_url, :name => connection.user.name, :is_friend => connection.user.friends?(current_user), :connection_state => connection.aasm_state }
end
child(:tracks => :tracks) {

View File

@ -88,7 +88,8 @@ module SampleApp
# Websocket-gateway embedded configs
config.websocket_gateway_enable = false
config.websocket_gateway_max_stale_connection_time = 1800
config.websocket_gateway_max_stale_connection_time = 300
config.websocket_gateway_max_reconnect_time = 1800
config.websocket_gateway_internal_debug = false
config.websocket_gateway_port = 6767
end

View File

@ -51,6 +51,7 @@ SampleApp::Application.configure do
# Websocket-gateway embedded configs
config.websocket_gateway_enable = true
config.websocket_gateway_max_stale_connection_time = 30
config.websocket_gateway_max_reconnect_time = 180
config.websocket_gateway_internal_debug = false
config.websocket_gateway_port = 6777

View File

@ -2,5 +2,6 @@ if Rails.application.config.websocket_gateway_enable
JamWebsockets::Server.new.run :port => Rails.application.config.websocket_gateway_port,
:emwebsocket_debug => Rails.application.config.websocket_gateway_internal_debug,
:max_stale_connection_time => Rails.application.config.websocket_gateway_max_stale_connection_time
end
:max_stale_connection_time => Rails.application.config.websocket_gateway_max_stale_connection_time,
:max_reconnect_time => Rails.application.config.websocket_gateway_max_reconnect_time
end