Class: Lucid::Shopify::ThrottledStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/lucid/shopify/throttled_strategy.rb

Overview

Maintain API call limit throttling across a single thread.

Direct Known Subclasses

RedisThrottledStrategy

Constant Summary collapse

MINIMUM_INTERVAL =

ms

500

Instance Method Summary collapse

Instance Method Details

#call(request, &send_request) ⇒ Response

Parameters:

Yield Returns:

Returns:



16
17
18
19
20
# File 'lib/lucid/shopify/throttled_strategy.rb', line 16

def call(request, &send_request)
  interval(build_interval_key(request))

  send_request.()
end