module Concurrent::Promises::AbstractEventFuture::ThrottleIntegration

Public Instance Methods

chain_throttled_by(throttle, *args, &block) click to toggle source

Behaves as {AbstractEventFuture#chain} but the it is throttled. @return [Future, Event] @see AbstractEventFuture#chain

# File lib-edge/concurrent/edge/throttle.rb, line 169
def chain_throttled_by(throttle, *args, &block)
  throttled_by(throttle) { |trigger| trigger.chain(*args, &block) }
end
throttled_by(throttle, &throttled_futures) click to toggle source

@yieldparam [Future] a trigger @yieldreturn [Future, Event] @return [Future, Event]

# File lib-edge/concurrent/edge/throttle.rb, line 161
def throttled_by(throttle, &throttled_futures)
  a_trigger = self & self.chain { throttle.trigger }.flat_event
  throttled_futures.call(a_trigger).on_resolution! { throttle.release }
end