Class: Datastar::ThreadExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/datastar/configuration.rb

Overview

The default executor based on Ruby threads

Direct Known Subclasses

RailsThreadExecutor

Instance Method Summary collapse

Instance Method Details

#new_queueObject



8
# File 'lib/datastar/configuration.rb', line 8

def new_queue = Queue.new

#prepare(response) ⇒ Object



10
# File 'lib/datastar/configuration.rb', line 10

def prepare(response); end

#spawn(&block) ⇒ Object



12
13
14
# File 'lib/datastar/configuration.rb', line 12

def spawn(&block)
  Thread.new(&block)
end

#stop(threads) ⇒ Object



16
17
18
# File 'lib/datastar/configuration.rb', line 16

def stop(threads)
  threads.each(&:kill)
end