Class: Couchbase::Options::GetAndLock

Inherits:
Base
  • Object
show all
Defined in:
lib/couchbase/options.rb

Overview

Constant Summary collapse

DEFAULT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

GetAndLock.new.freeze

Instance Attribute Summary collapse

Attributes inherited from Base

#client_context, #parent_span, #retry_strategy, #timeout

Instance Method Summary collapse

Constructor Details

#initialize(transcoder: JsonTranscoder.new, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ GetAndLock

Creates an instance of options for Collection#get_and_lock

Parameters:

  • transcoder (JsonTranscoder, #decode(String, Integer)) (defaults to: JsonTranscoder.new)

    used for decoding

  • timeout (Integer, #in_milliseconds, nil) (defaults to: nil)
  • retry_strategy (Proc, nil) (defaults to: nil)

    the custom retry strategy, if set

  • client_context (Hash, nil) (defaults to: nil)

    the client context data, if set

  • parent_span (Span, nil) (defaults to: nil)

    if set holds the parent span, that should be used for this request

Yield Parameters:



181
182
183
184
185
186
187
188
189
# File 'lib/couchbase/options.rb', line 181

def initialize(transcoder: JsonTranscoder.new,
               timeout: nil,
               retry_strategy: nil,
               client_context: nil,
               parent_span: nil)
  super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span)
  @transcoder = transcoder
  yield self if block_given?
end

Instance Attribute Details

#transcoderJsonTranscoder, #decode(String, Integer)

Returns:



169
170
171
# File 'lib/couchbase/options.rb', line 169

def transcoder
  @transcoder
end

Instance Method Details

#to_backendObject

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.



192
193
194
195
196
# File 'lib/couchbase/options.rb', line 192

def to_backend
  {
    timeout: Utils::Time.extract_duration(@timeout),
  }
end