Class: CommandTower::Clients::Transport::FaradayConfig
- Inherits:
-
Data
- Object
- Data
- CommandTower::Clients::Transport::FaradayConfig
- 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
-
#idle_timeout ⇒ Object
readonly
Returns the value of attribute idle_timeout.
-
#open_timeout ⇒ Object
readonly
Returns the value of attribute open_timeout.
-
#pool_size ⇒ Object
readonly
Returns the value of attribute pool_size.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Class Method Summary collapse
-
.defaults ⇒ Object
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.
- .from_env ⇒ Object
Instance Attribute Details
#idle_timeout ⇒ Object (readonly)
Returns the value of attribute idle_timeout
6 7 8 |
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 6 def idle_timeout @idle_timeout end |
#open_timeout ⇒ Object (readonly)
Returns the value of attribute open_timeout
6 7 8 |
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 6 def open_timeout @open_timeout end |
#pool_size ⇒ Object (readonly)
Returns the value of attribute pool_size
6 7 8 |
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 6 def pool_size @pool_size end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout
6 7 8 |
# File 'app/services/command_tower/clients/transport/faraday_config.rb', line 6 def timeout @timeout end |
Class Method Details
.defaults ⇒ Object
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_env ⇒ Object
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 |