Module: Concurrent::SerialExecutor

Includes:
Executor
Included in:
ImmediateExecutor, JavaSingleThreadExecutor, RubySingleThreadExecutor, SerializedExecutionDelegator
Defined in:
lib/concurrent/executor/executor.rb

Overview

Indicates that the including ‘Executor` or `ExecutorService` guarantees that all operations will occur in the order they are post and that no two operations may occur simultaneously. This module provides no functionality and provides no guarantees. That is the responsibility of the including class. This module exists solely to allow the including object to be interrogated for its serialization status.

Examples:

class Foo
  include Concurrent::SerialExecutor
end

foo = Foo.new

foo.is_a? Concurrent::Executor       #=> true
foo.is_a? Concurrent::SerialExecutor #=> true
foo.serialized?                      #=> true

Instance Method Summary collapse

Methods included from Executor

#can_overflow?

Instance Method Details

#serialized?Boolean

Note:

Always returns ‘true`

Does this executor guarantee serialization of its operations?

Returns:

  • (Boolean)

    True if the executor guarantees that all operations will be post in the order they are received and no two operations may occur simultaneously. Else false.



57
58
59
# File 'lib/concurrent/executor/executor.rb', line 57

def serialized?
  true
end