Class: Couchbase::Protostellar::Timeouts Private
- Inherits:
-
Object
- Object
- Couchbase::Protostellar::Timeouts
- Defined in:
- lib/couchbase/protostellar/timeouts.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #analytics_timeout ⇒ Object readonly private
- #key_value_timeout ⇒ Object readonly private
- #management_timeout ⇒ Object readonly private
- #query_timeout ⇒ Object readonly private
- #search_timeout ⇒ Object readonly private
- #view_timeout ⇒ Object readonly private
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key_value_timeout: nil, key_value_durable_timeout: nil, view_timeout: nil, query_timeout: nil, analytics_timeout: nil, search_timeout: nil, management_timeout: nil) ⇒ Timeouts
constructor
private
A new instance of Timeouts.
- #timeout_for_request(request) ⇒ Object private
Constructor Details
#initialize(key_value_timeout: nil, key_value_durable_timeout: nil, view_timeout: nil, query_timeout: nil, analytics_timeout: nil, search_timeout: nil, management_timeout: nil) ⇒ Timeouts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Timeouts.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 30 def initialize( key_value_timeout: nil, key_value_durable_timeout: nil, view_timeout: nil, query_timeout: nil, analytics_timeout: nil, search_timeout: nil, management_timeout: nil ) @key_value_durable_timeout = key_value_durable_timeout || TimeoutDefaults::KEY_VALUE_DURABLE @key_value_timeout = key_value_timeout || TimeoutDefaults::KEY_VALUE @view_timeout = view_timeout || TimeoutDefaults::VIEW @query_timeout = query_timeout || TimeoutDefaults::QUERY @analytics_timeout = analytics_timeout || TimeoutDefaults::ANALYTICS @search_timeout = search_timeout || TimeoutDefaults::SEARCH @management_timeout = management_timeout || TimeoutDefaults::MANAGEMENT end |
Instance Attribute Details
#analytics_timeout ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 26 def analytics_timeout @analytics_timeout end |
#key_value_timeout ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 23 def key_value_timeout @key_value_timeout end |
#management_timeout ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 28 def management_timeout @management_timeout end |
#query_timeout ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 25 def query_timeout @query_timeout end |
#search_timeout ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 27 def search_timeout @search_timeout end |
#view_timeout ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 24 def view_timeout @view_timeout end |
Class Method Details
.from_cluster_options(options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 71 def self.() Timeouts.new( key_value_timeout: .key_value_timeout, view_timeout: .view_timeout, query_timeout: .query_timeout, analytics_timeout: .analytics_timeout, search_timeout: .search_timeout, management_timeout: .management_timeout ) end |
Instance Method Details
#timeout_for_request(request) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/couchbase/protostellar/timeouts.rb', line 48 def timeout_for_request(request) case request.service when :analytics @analytics_timeout when :kv if request.proto_request.respond_to?(:durability_level) && request.proto_request.has_durability_level? @key_value_durable_timeout else @key_value_timeout end when :query @query_timeout when :search @search_timeout when :view @view_timeout when :bucket_admin, :collection_admin, :query_admin, :search_admin @management_timeout else raise Couchbase::Error::CouchbaseError, "Service #{service} not recognised" end end |