Class: Jbr::Retriable
Overview
Jobber refusing a query over what it costs rather than over anything about the query. The bucket it is priced against refills, so the same question asked later is answered.
Instance Attribute Summary collapse
-
#available ⇒ Object
readonly
What the query would have cost, the budget it was priced against, and how fast that budget refills.
-
#cost ⇒ Object
readonly
What the query would have cost, the budget it was priced against, and how fast that budget refills.
-
#maximum ⇒ Object
readonly
What the query would have cost, the budget it was priced against, and how fast that budget refills.
-
#restore_rate ⇒ Object
readonly
What the query would have cost, the budget it was priced against, and how fast that budget refills.
Instance Method Summary collapse
-
#initialize(message, cost = {}) ⇒ Retriable
constructor
A new instance of Retriable.
Constructor Details
#initialize(message, cost = {}) ⇒ Retriable
Returns a new instance of Retriable.
7 8 9 10 11 12 13 14 |
# File 'lib/jbr/retriable.rb', line 7 def initialize(, cost = {}) super status = cost['throttleStatus'].to_h @cost = cost['requestedQueryCost'] @available = status['currentlyAvailable'] @maximum = status['maximumAvailable'] @restore_rate = status['restoreRate'] end |
Instance Attribute Details
#available ⇒ Object (readonly)
What the query would have cost, the budget it was priced against, and how fast that budget refills. A cost above the maximum is one no waiting will pay for.
18 19 20 |
# File 'lib/jbr/retriable.rb', line 18 def available @available end |
#cost ⇒ Object (readonly)
What the query would have cost, the budget it was priced against, and how fast that budget refills. A cost above the maximum is one no waiting will pay for.
18 19 20 |
# File 'lib/jbr/retriable.rb', line 18 def cost @cost end |
#maximum ⇒ Object (readonly)
What the query would have cost, the budget it was priced against, and how fast that budget refills. A cost above the maximum is one no waiting will pay for.
18 19 20 |
# File 'lib/jbr/retriable.rb', line 18 def maximum @maximum end |
#restore_rate ⇒ Object (readonly)
What the query would have cost, the budget it was priced against, and how fast that budget refills. A cost above the maximum is one no waiting will pay for.
18 19 20 |
# File 'lib/jbr/retriable.rb', line 18 def restore_rate @restore_rate end |