Class: CommandTower::Clients::Transport::FaradayConfig

Inherits:
Data
  • Object
show all
Defined in:
app/services/command_tower/clients/transport/faraday_config.rb

Constant Summary collapse

DEFAULT_POOL_SIZE =
5
DEFAULT_IDLE_TIMEOUT =
30
DEFAULT_OPEN_TIMEOUT =
5
DEFAULT_TIMEOUT =
30

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#idle_timeoutObject (readonly)

Returns the value of attribute idle_timeout

Returns:

  • (Object)

    the current value of idle_timeout



6
7
8
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 6

def idle_timeout
  @idle_timeout
end

#open_timeoutObject (readonly)

Returns the value of attribute open_timeout

Returns:

  • (Object)

    the current value of open_timeout



6
7
8
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 6

def open_timeout
  @open_timeout
end

#pool_sizeObject (readonly)

Returns the value of attribute pool_size

Returns:

  • (Object)

    the current value of pool_size



6
7
8
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 6

def pool_size
  @pool_size
end

#timeoutObject (readonly)

Returns the value of attribute timeout

Returns:

  • (Object)

    the current value of timeout



6
7
8
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 6

def timeout
  @timeout
end

Class Method Details

.defaultsObject

pool_size — ConnectionPool size (concurrent Faraday::Connection checkouts) idle_timeout — net_http_persistent idle timeout per pooled connection open_timeout — Faraday open timeout and ConnectionPool checkout timeout timeout — default per-request Faraday timeout



17
18
19
20
21
22
23
24
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 17

def self.defaults
  new(
    pool_size: DEFAULT_POOL_SIZE,
    idle_timeout: DEFAULT_IDLE_TIMEOUT,
    open_timeout: DEFAULT_OPEN_TIMEOUT,
    timeout: DEFAULT_TIMEOUT
  )
end

.from_envObject



26
27
28
29
30
31
32
33
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 26

def self.from_env
  new(
    pool_size: integer_env("CLIENTS_HTTP_POOL_SIZE", DEFAULT_POOL_SIZE),
    idle_timeout: integer_env("CLIENTS_HTTP_IDLE_TIMEOUT", DEFAULT_IDLE_TIMEOUT),
    open_timeout: integer_env("CLIENTS_HTTP_OPEN_TIMEOUT", DEFAULT_OPEN_TIMEOUT),
    timeout: integer_env("CLIENTS_HTTP_TIMEOUT", DEFAULT_TIMEOUT)
  )
end