Class: Shouter::Listeners::Async
- Inherits:
-
Object
- Object
- Shouter::Listeners::Async
- Includes:
- Mixin
- Defined in:
- lib/shouter/listeners/async.rb
Instance Attribute Summary collapse
-
#thread_exists ⇒ Object
readonly
Returns the value of attribute thread_exists.
Instance Method Summary collapse
Methods included from Mixin
Instance Attribute Details
#thread_exists ⇒ Object (readonly)
Returns the value of attribute thread_exists.
7 8 9 |
# File 'lib/shouter/listeners/async.rb', line 7 def thread_exists @thread_exists end |
Instance Method Details
#notify!(scope, event, args, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/shouter/listeners/async.rb', line 9 def notify!(scope, event, args, &block) return unless notify?(scope, event) return if thread_exists? create_thread Thread.new do object.public_send(event, *args) fire_hook!([:callback] || block) end unregister(object) end |