Class: Thread

Inherits:
Object show all
Defined in:
lib/vex/base/thread/sleep.rb,
lib/vex/base/thread/deferred.rb

Defined Under Namespace

Modules: Etest

Class Method Summary collapse

Class Method Details

.deferred(&block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/vex/base/thread/deferred.rb', line 6

def self.deferred(&block)
  new { 
    Thread.current.abort_on_exception = true
    
    begin
      yield
    rescue
      App.logger.warn "Caught exception in background processing: #{$!}"
    end
  }
end

.uidObject



2
3
4
# File 'lib/vex/base/thread/deferred.rb', line 2

def self.uid
  "#{$$}.#{Thread.current.object_id}"
end