Class: Af::QThread::Base

Inherits:
Thread
  • Object
show all
Includes:
Interface
Defined in:
lib/fiksu-af/q_thread/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Interface

#has_message?, #post_data_message, #post_message, #read_message, #requeue

Constructor Details

#initializeBase

Returns a new instance of Base.



5
6
7
8
# File 'lib/fiksu-af/q_thread/base.rb', line 5

def initialize
  @queue = Queue.new
  super
end

Instance Attribute Details

#queueObject (readonly)

Returns the value of attribute queue.



3
4
5
# File 'lib/fiksu-af/q_thread/base.rb', line 3

def queue
  @queue
end

Instance Method Details

#kick_start(from = Thread.current) ⇒ Object



16
17
18
# File 'lib/fiksu-af/q_thread/base.rb', line 16

def kick_start(from = Thread.current)
  post_data_message(:kick_start, from)
end

#request_termination(from = Thread.current) ⇒ Object



12
13
14
# File 'lib/fiksu-af/q_thread/base.rb', line 12

def request_termination(from = Thread.current)
  post_data_message(:terminate, from)
end