Sha256: 1ab7a584f6632a18cc1a2ee4bdcf61cca2df4c85a41ac0b45a491620b0467e7e
Contents?: true
Size: 859 Bytes
Versions: 314
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
314 entries across 289 versions & 56 rubygems