Class: Async::Notifications

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

Overview

TODO: test this

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.handlerObject

Returns the value of attribute handler.



47
48
49
# File 'lib/async.rb', line 47

def handler
  @handler
end

Class Method Details

.notify_job(thing, receiver, method_name, args) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/async.rb', line 52

def self.notify_job(thing, receiver, method_name, args)
  handler && handler.call(thing, {
    :receiver => receiver,
    :method_name => method_name.to_sym,
    :args => args
  })
end

.notify_lock(thing, lock_name) ⇒ Object



49
50
51
# File 'lib/async.rb', line 49

def self.notify_lock(thing, lock_name)
  handler && handler.call(thing, {:lock_name => lock_name})
end