class Concurrent::SerializedExecution
def posts(posts)
-
posts
(Array
) -- array of triplets where, Proc)>
def posts(posts) # if can_overflow? # raise ArgumentError, 'SerializedExecution does not support thread-pools which can overflow' # end return nil if posts.empty? jobs = posts.map { |executor, args, task| Job.new executor, args, task } job_to_post = synchronize do if @being_executed @stash.push(*jobs) nil else @being_executed = true @stash.push(*jobs[1..-1]) jobs.first end end call_job job_to_post if job_to_post true end