Sha256: c19164bf780417793324db55bbd1d81708f0f12bce3b5df658e267a8f39f9c6d

Contents?: true

Size: 676 Bytes

Versions: 43

Compression:

Stored size: 676 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))

with_rackup do
  Shindo.tests do
    test('threaded requests') do
      connection = Excon.new('http://127.0.0.1:9292')

      long_thread = Thread.new {
        response = connection.request(:method => 'GET', :path => '/id/1/wait/2')
        Thread.current[:success] = response.body == '1'
      }

      short_thread = Thread.new {
        response = connection.request(:method => 'GET', :path => '/id/2/wait/1')
        Thread.current[:success] = response.body == '2'
      }

      long_thread.join
      short_thread.join

      long_thread[:success] && short_thread[:success]
    end
  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
excon-0.1.3 tests/threaded_tests.rb
excon-0.1.2 tests/threaded_tests.rb
excon-0.1.1 tests/threaded_tests.rb
excon-0.1.0 tests/threaded_tests.rb
excon-0.0.26 tests/threaded_tests.rb
excon-0.0.25 tests/threaded_tests.rb
excon-0.0.24 tests/threaded_tests.rb
excon-0.0.23 tests/threaded_tests.rb
excon-0.0.22 tests/threaded_tests.rb
excon-0.0.21 tests/threaded_tests.rb
excon-0.0.20 tests/threaded_tests.rb
excon-0.0.19 tests/threaded_tests.rb
excon-0.0.18 tests/threaded_tests.rb
excon-0.0.17 tests/threaded_tests.rb
excon-0.0.16 tests/threaded_tests.rb
excon-0.0.15 tests/threaded_tests.rb
excon-0.0.14 tests/threaded_tests.rb
excon-0.0.13 tests/threaded_tests.rb
excon-0.0.12 tests/threaded_tests.rb
excon-0.0.11 tests/threaded_tests.rb