lib/falcon/capybara/wrapper.rb in falcon-capybara-1.3.5 vs lib/falcon/capybara/wrapper.rb in falcon-capybara-1.3.6
- old
+ new
@@ -18,10 +18,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
require 'thread'
+require 'async/reactor'
require 'async/io/host_endpoint'
require 'async/io/notification'
module Falcon
module Capybara
@@ -46,19 +47,28 @@
Async.logger.debug (self) {"Waiting for job completion..."}
@job_complete.wait
end.wait
end
+ def protocol
+ Async::HTTP::Protocol::HTTP1
+ end
+
+ def scheme
+ "http"
+ end
+
def call(rack_app, port, host)
require 'async/reactor'
require 'falcon/server'
Async::Reactor.run do |task|
app = Falcon::Server.middleware(rack_app)
server = Falcon::Server.new(app,
- Async::IO::Endpoint.tcp(host, port)
+ Async::IO::Endpoint.tcp(host, port),
+ protocol, scheme
)
task.async do
Async.logger.debug (self) {"Running server..."}
server.run
@@ -70,9 +80,10 @@
Async.logger.debug (self) {"Running job #{@job}"}
@job.call
@job = nil
+ Async.logger.debug (self) {"Completing job #{@job}"}
@job_complete.signal
end
end
end
end