Sha256: 1ab7a584f6632a18cc1a2ee4bdcf61cca2df4c85a41ac0b45a491620b0467e7e

Contents?: true

Size: 859 Bytes

Versions: 319

Compression:

Stored size: 859 Bytes

Contents

require 'delegate'
require 'concurrent/executor/serial_executor_service'
require 'concurrent/executor/serialized_execution'

module Concurrent

  # A wrapper/delegator for any `ExecutorService` that
  # guarantees serialized execution of tasks.
  #
  # @see [SimpleDelegator](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html)
  # @see Concurrent::SerializedExecution
  class SerializedExecutionDelegator < SimpleDelegator
    include SerialExecutorService

    def initialize(executor)
      @executor   = executor
      @serializer = SerializedExecution.new
      super(executor)
    end

    # @!macro executor_service_method_post
    def post(*args, &task)
      raise ArgumentError.new('no block given') unless block_given?
      return false unless running?
      @serializer.post(@executor, *args, &task)
    end
  end
end

Version data entries

319 entries across 293 versions & 59 rubygems

Version Path
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
concurrent-ruby-1.2.3 lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.1.96 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.1.95 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
harbr-0.1.94 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb