Navigation Menu

Skip to content

Commit

Permalink
Timeout thread receiver with 10sec
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 14, 2015
1 parent e6d177b commit 5641dd1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/droonga/client/connection/droonga-protocol/thread.rb
Expand Up @@ -23,6 +23,8 @@ class Client
module Connection
class DroongaProtocol
class Thread
DEFAULT_TIMEOUT_SECONDS = 10

class Request
def initialize(thread)
@thread = thread
Expand Down Expand Up @@ -81,7 +83,7 @@ def subscribe(message, options={}, &block)
subscription_timeout = options[:subscription_timeout]
start = Time.now
receive_options = {
:timeout => options[:timeout],
:timeout => options[:timeout] || DEFAULT_TIMEOUT_SECONDS,
}
sync = block.nil?
if sync
Expand Down

0 comments on commit 5641dd1

Please sign in to comment.