class Concurrent::Throttle::ProxyExecutor

Public Class Methods

new(throttle, executor) click to toggle source
Calls superclass method
# File lib/concurrent-ruby-edge/concurrent/edge/throttle.rb, line 192
def initialize(throttle, executor)
  super()
  @Throttle = throttle
  @Executor = executor
end

Public Instance Methods

can_overflow?() click to toggle source
# File lib/concurrent-ruby-edge/concurrent/edge/throttle.rb, line 206
def can_overflow?
  @Executor.can_overflow?
end
post(*args, &task) click to toggle source
# File lib/concurrent-ruby-edge/concurrent/edge/throttle.rb, line 198
def post(*args, &task)
  if (event = @Throttle.acquire_or_event)
    event.on_resolution! { inner_post(*args, &task) }
  else
    inner_post(*args, &task)
  end
end
serialized?() click to toggle source
# File lib/concurrent-ruby-edge/concurrent/edge/throttle.rb, line 210
def serialized?
  @Executor.serialized?
end

Private Instance Methods

inner_post(*arguments, &task) click to toggle source
# File lib/concurrent-ruby-edge/concurrent/edge/throttle.rb, line 216
def inner_post(*arguments, &task)
  @Executor.post(*arguments) do |*args|
    begin
      task.call(*args)
    ensure
      @Throttle.release
    end
  end
end