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.4.0 tests/threaded_tests.rb
excon-0.3.8 tests/threaded_tests.rb
excon-0.3.7 tests/threaded_tests.rb
excon-0.3.6 tests/threaded_tests.rb
excon-0.3.5 tests/threaded_tests.rb
excon-0.3.4 tests/threaded_tests.rb
excon-0.3.3 tests/threaded_tests.rb
excon-0.3.2 tests/threaded_tests.rb
excon-0.3.1 tests/threaded_tests.rb
excon-0.3.0 tests/threaded_tests.rb
excon-0.2.8 tests/threaded_tests.rb
excon-0.2.7 tests/threaded_tests.rb
excon-0.2.6 tests/threaded_tests.rb
bbcloud-0.8.1 lib/bbcloud/vendor/excon-0.2.4/tests/threaded_tests.rb
excon-0.2.4 tests/threaded_tests.rb
excon-0.2.3 tests/threaded_tests.rb
excon-0.2.2 tests/threaded_tests.rb
excon-0.2.1 tests/threaded_tests.rb
excon-0.2.0 tests/threaded_tests.rb
excon-0.1.4 tests/threaded_tests.rb