Class: HTTPX::Options::Timeouts

Inherits:
Struct
  • Object
show all
Defined in:
lib/httpx/options.rb,
sig/options.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connect_timeout: nil, settings_timeout: nil, read_timeout: nil, write_timeout: nil, request_timeout: nil, total_request_timeout: nil, operation_timeout: nil, close_handshake_timeout: nil, keep_alive_timeout: nil, ping_timeout: nil) ⇒ Timeouts

Returns a new instance of Timeouts.

Parameters:

  • connect_timeout: (interval, nil) (defaults to: nil)
  • settings_timeout: (interval, nil) (defaults to: nil)
  • read_timeout: (interval, nil) (defaults to: nil)
  • write_timeout: (interval, nil) (defaults to: nil)
  • request_timeout: (interval, nil) (defaults to: nil)
  • total_request_timeout: (interval, nil) (defaults to: nil)
  • operation_timeout: (interval, nil) (defaults to: nil)
  • close_handshake_timeout: (interval, nil) (defaults to: nil)
  • keep_alive_timeout: (interval, nil) (defaults to: nil)
  • ping_timeout: (interval, nil) (defaults to: nil)


559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/httpx/options.rb', line 559

def initialize(
  connect_timeout: nil,
  settings_timeout: nil,
  read_timeout: nil,
  write_timeout: nil,
  request_timeout: nil,
  total_request_timeout: nil,
  operation_timeout: nil,
  close_handshake_timeout: nil,
  keep_alive_timeout: nil,
  ping_timeout: nil
)
  super
  freeze
end

Instance Attribute Details

#close_handshake_timeout ⇒ Object

Returns the value of attribute close_handshake_timeout

Returns:

  • (Object) —

    the current value of close_handshake_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def close_handshake_timeout
  @close_handshake_timeout
end

#connect_timeout ⇒ Object

Returns the value of attribute connect_timeout

Returns:

  • (Object) —

    the current value of connect_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def connect_timeout
  @connect_timeout
end

#keep_alive_timeout ⇒ Object

Returns the value of attribute keep_alive_timeout

Returns:

  • (Object) —

    the current value of keep_alive_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def keep_alive_timeout
  @keep_alive_timeout
end

#operation_timeout ⇒ Object

Returns the value of attribute operation_timeout

Returns:

  • (Object) —

    the current value of operation_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def operation_timeout
  @operation_timeout
end

#ping_timeout ⇒ Object

Returns the value of attribute ping_timeout

Returns:

  • (Object) —

    the current value of ping_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def ping_timeout
  @ping_timeout
end

#read_timeout ⇒ Object

Returns the value of attribute read_timeout

Returns:

  • (Object) —

    the current value of read_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def read_timeout
  @read_timeout
end

#request_timeout ⇒ Object

Returns the value of attribute request_timeout

Returns:

  • (Object) —

    the current value of request_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def request_timeout
  @request_timeout
end

#settings_timeout ⇒ Object

Returns the value of attribute settings_timeout

Returns:

  • (Object) —

    the current value of settings_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def settings_timeout
  @settings_timeout
end

#total_request_timeout ⇒ Object

Returns the value of attribute total_request_timeout

Returns:

  • (Object) —

    the current value of total_request_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def total_request_timeout
  @total_request_timeout
end

#write_timeout ⇒ Object

Returns the value of attribute write_timeout

Returns:

  • (Object) —

    the current value of write_timeout



552
553
554
# File 'lib/httpx/options.rb', line 552

def write_timeout
  @write_timeout
end

Instance Method Details

#[] ⇒ interval?

Parameters:

  • (Symbol)

Returns:

  • (interval, nil)


261
# File 'sig/options.rbs', line 261

def []: (Symbol) -> interval?

#merge(other) ⇒ Timeouts

Parameters:

Returns:



603
604
605
606
607
# File 'lib/httpx/options.rb', line 603

def merge(other)
  other_h = other.to_h
  other_h.compact!
  Timeouts.new(**to_h, **other_h)
end

#to_h ⇒ Hash[Symbol, interval?]

Returns:

  • (Hash[Symbol, interval?])


263
# File 'sig/options.rbs', line 263

def to_h: () -> Hash[Symbol, interval?]