mirror of
https://github.com/teampoltergeist/poltergeist.git
synced 2022-11-09 12:05:00 -05:00

Using EventMachine was causing issues when run alongside Thin. In general running the event loop is quite slow, presumably because it is mostly spinning idly wasting cycles (unsure). We were mitigating this by stopping the thread when it wasn't needed, but this is incorrect when Thin is also running. Implemented WebSocket server using raw TCP sockets and a WebSocket parser provided by faye-websocket. This is faster and neater and removes the need to dick around with threads. Fixes #6.
19 lines
648 B
Ruby
19 lines
648 B
Ruby
require 'capybara'
|
|
|
|
module Capybara
|
|
module Poltergeist
|
|
autoload :Driver, 'capybara/poltergeist/driver'
|
|
autoload :Browser, 'capybara/poltergeist/browser'
|
|
autoload :Node, 'capybara/poltergeist/node'
|
|
autoload :ServerManager, 'capybara/poltergeist/server_manager'
|
|
autoload :Server, 'capybara/poltergeist/server'
|
|
autoload :WebSocketServer, 'capybara/poltergeist/web_socket_server'
|
|
autoload :Client, 'capybara/poltergeist/client'
|
|
|
|
require 'capybara/poltergeist/errors'
|
|
end
|
|
end
|
|
|
|
Capybara.register_driver :poltergeist do |app|
|
|
Capybara::Poltergeist::Driver.new(app)
|
|
end
|