Skip to content

Commit

Permalink
breaking out the timeout override and transport checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhodges committed Mar 1, 2010
1 parent 10ad4e5 commit 5a804ab
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/thrift_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,16 @@ def set_method_timeouts!
end

def has_timeouts!
if @options[:timeout_overrides].any?
if (@options[:transport_wrapper] || @options[:transport]).method_defined?(:timeout=)
return true
else
warn "ThriftClient: Timeout overrides have no effect with with transport type #{(@options[:transport_wrapper] || @options[:transport])}"
end
transport_can_timeout? if @options[:timeout_overrides].any?
end

def transport_can_timeout?
if (@options[:transport_wrapper] || @options[:transport]).method_defined?(:timeout=)
true
else
warn "ThriftClient: Timeout overrides have no effect with with transport type #{(@options[:transport_wrapper] || @options[:transport])}"
false
end
false
end
end

Expand Down

0 comments on commit 5a804ab

Please sign in to comment.