123456789_123456789_123456789_123456789_123456789_

Module: Concurrent::ExecutorService

Constant Summary

Concern::Logging - Included

SEV_LABEL

Instance Attribute Summary

Instance Method Summary

Concern::Logging - Included

#log

Logs through global_logger, it can be overridden by setting @logger.

Instance Attribute Details

#can_overflow?Boolean (readonly)

Note:

Always returns false

Does the task queue have a maximum size?

Returns:

  • (Boolean)

    True if the task queue has a maximum size else false.

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/executor/executor_service.rb', line 174

module ExecutorService
  include Concern::Logging

  # @!macro executor_service_method_post
  def post(*args, &task)
    raise NotImplementedError
  end

  # @!macro executor_service_method_left_shift
  def <<(task)
    post(&task)
    self
  end

  # @!macro executor_service_method_can_overflow_question
  #
  # @note Always returns `false`
  def can_overflow?
    false
  end

  # @!macro executor_service_method_serialized_question
  #
  # @note Always returns `false`
  def serialized?
    false
  end
end

#serialized?Boolean (readonly)

Note:

Always returns false

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.

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/executor/executor_service.rb', line 181

module ExecutorService
  include Concern::Logging

  # @!macro executor_service_method_post
  def post(*args, &task)
    raise NotImplementedError
  end

  # @!macro executor_service_method_left_shift
  def <<(task)
    post(&task)
    self
  end

  # @!macro executor_service_method_can_overflow_question
  #
  # @note Always returns `false`
  def can_overflow?
    false
  end

  # @!macro executor_service_method_serialized_question
  #
  # @note Always returns `false`
  def serialized?
    false
  end
end

Instance Method Details

#<<(task) ⇒ self

Submit a task to the executor for asynchronous processing.

Parameters:

  • task (Proc)

    the asynchronous task to perform

Returns:

  • (self)

    returns itself

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/executor/executor_service.rb', line 166

module ExecutorService
  include Concern::Logging

  # @!macro executor_service_method_post
  def post(*args, &task)
    raise NotImplementedError
  end

  # @!macro executor_service_method_left_shift
  def <<(task)
    post(&task)
    self
  end

  # @!macro executor_service_method_can_overflow_question
  #
  # @note Always returns `false`
  def can_overflow?
    false
  end

  # @!macro executor_service_method_serialized_question
  #
  # @note Always returns `false`
  def serialized?
    false
  end
end

#post(*args) { ... } ⇒ Boolean

Submit a task to the executor for asynchronous processing.

Parameters:

  • args (Array)

    zero or more arguments to be passed to the task

Yields:

  • the asynchronous task to perform

Returns:

  • (Boolean)

    true if the task is queued, false if the executor is not running

Raises:

  • (ArgumentError)

    if no task is given

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/executor/executor_service.rb', line 161

module ExecutorService
  include Concern::Logging

  # @!macro executor_service_method_post
  def post(*args, &task)
    raise NotImplementedError
  end

  # @!macro executor_service_method_left_shift
  def <<(task)
    post(&task)
    self
  end

  # @!macro executor_service_method_can_overflow_question
  #
  # @note Always returns `false`
  def can_overflow?
    false
  end

  # @!macro executor_service_method_serialized_question
  #
  # @note Always returns `false`
  def serialized?
    false
  end
end