class Concurrent::SerializedExecutionDelegator

A wrapper/delegator for any `ExecutorService` that guarantees serialized execution of tasks.

@see [SimpleDelegator](www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html) @see Concurrent::SerializedExecution

Public Class Methods

new(executor) click to toggle source
Calls superclass method
# File lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb, line 15
def initialize(executor)
  @executor   = executor
  @serializer = SerializedExecution.new
  super(executor)
end

Public Instance Methods

post(*args, &task) click to toggle source

@!macro executor_service_method_post

# File lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb, line 22
def post(*args, &task)
  raise ArgumentError.new('no block given') unless block_given?
  return false unless running?
  @serializer.post(@executor, *args, &task)
end