RailsCasts Pro episodes are now free!

Learn more or hide this

Rishi Shah's Profile

GitHub User: bobbungee

Comments by Rishi Shah

Avatar

I made a typo, it should simply be:

SwingUtilities.invokeLater do
    HelloWorld.new
end
Avatar

Thanks for this Ryan! One thing I'd like to mention is that Swing components should always be initialized on the EDT (Event Dispatch Thread). So, instead of HelloWorld.new :

java_import javax.swing.SwingUtilities

...

SwingUtilities.invokeLater do |e|
    HelloWorld.new
end

This will prevent deadlocks and other unwanted behavior from happening.

Avatar

Since thin's default timeout is 30 seconds, it is better to use this:

faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 25)