Class: Concurrent::ImmediateExecutor

Inherits:
Object
  • Object
show all
Includes:
Executor
Defined in:
lib/concurrent/executor/immediate_executor.rb

Instance Method Summary collapse

Methods included from Executor

#can_overflow?

Instance Method Details

#<<(task) ⇒ Object



11
12
13
14
# File 'lib/concurrent/executor/immediate_executor.rb', line 11

def <<(task)
  post(&task)
  self
end

#post(*args, &task) ⇒ Object

Raises:

  • (ArgumentError)


5
6
7
8
9
# File 'lib/concurrent/executor/immediate_executor.rb', line 5

def post(*args, &task)
  raise ArgumentError.new('no block given') unless block_given?
  task.call(*args)
  true
end