class At_email::Tasks::TaskThread

Constants

CLASS_DISPLAY_NAME

Attributes

thread_ref[RW]

Public Class Methods

new() click to toggle source
Calls superclass method At_email::Core::Default::new
# File lib/at_email/threads/thread_queue.rb, line 55
def initialize
  super
  if !@properties
    return false
  end
  @properties['Display Name'] = CLASS_DISPLAY_NAME
end

Public Instance Methods

queue(code) click to toggle source
# File lib/at_email/threads/thread_queue.rb, line 63
def queue(code)
  log_string = 'Queueing'
  log_event('D', event_data)
  set('Queue Time', Time.now)
  Thread.abort_on_exception = true
  @thread_ref = Thread.new do
    sleep 0.1
    code
  end
end
start() click to toggle source
# File lib/at_email/threads/thread_queue.rb, line 74
def start
  @properties['Start Time'] = Time.now
end
stop() click to toggle source
# File lib/at_email/threads/thread_queue.rb, line 78
def stop
  @properties['Stop Time'] = Time.now
  Thread.kill(@thread_ref)
end