aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-05-08 01:36:39 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-05-08 15:17:15 +0900
commit4e67368773d4343ea953518f26af92110e4ccd2d (patch)
tree74015e6d677391fa941f918465f3a74e4f81feb4
parent2a24328e1e4a81f696f6386b4c8889bf658b9bec (diff)
downloadplum-4e67368773d4343ea953518f26af92110e4ccd2d.tar.gz
client: Client#resume always waits all requests
-rw-r--r--lib/plum/client.rb13
-rw-r--r--test/plum/client/test_client.rb2
2 files changed, 4 insertions, 11 deletions
diff --git a/lib/plum/client.rb b/lib/plum/client.rb
index 55325a8..bdbfd72 100644
--- a/lib/plum/client.rb
+++ b/lib/plum/client.rb
@@ -54,16 +54,9 @@ module Plum
self
end
- # Resume communication with the server, until the specified (or all running) requests are complete.
- # @param response [Response] if specified, waits only for the response
- # @return [Response] if parameter response is specified
- def resume(response = nil)
- if response
- @session.succ until response.failed? || response.finished?
- response
- else
- @session.succ until @session.empty?
- end
+ # Resume communication with the server until all running requests are complete.
+ def resume
+ @session.succ until @session.empty?
end
# Closes the connection immediately.
diff --git a/test/plum/client/test_client.rb b/test/plum/client/test_client.rb
index 2a4d8b6..c6c7af7 100644
--- a/test/plum/client/test_client.rb
+++ b/test/plum/client/test_client.rb
@@ -37,7 +37,7 @@ class ClientTest < Minitest::Test
client = Client.start("127.0.0.1", LISTEN_PORT, https: true, verify_mode: OpenSSL::SSL::VERIFY_NONE)
res = client.get("/error_in_data")
assert_raises(LocalConnectionError) {
- client.resume(res)
+ client.resume
}
client.close
ensure