Module: Tribe::Actable
Instance Method Summary collapse
- #alive? ⇒ Boolean
- #event!(event) ⇒ Object
- #future!(command, data = nil, source = nil) ⇒ Object
- #identifier ⇒ Object
- #message!(command, data = nil, source = nil) ⇒ Object
- #name ⇒ Object
- #perform!(&block) ⇒ Object
- #shutdown! ⇒ Object
Instance Method Details
#alive? ⇒ Boolean
70 71 72 |
# File 'lib/tribe/actable.rb', line 70 def alive? @_as.mailbox.alive? end |
#event!(event) ⇒ Object
39 40 41 42 43 |
# File 'lib/tribe/actable.rb', line 39 def event!(event) push_event(event) return nil end |
#future!(command, data = nil, source = nil) ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/tribe/actable.rb', line 53 def future!(command, data = nil, source = nil) event = Tribe::Event.new(command, data, source) event.future = future = Tribe::Future.new push_event(event) return future end |
#identifier ⇒ Object
78 79 80 |
# File 'lib/tribe/actable.rb', line 78 def identifier return @_as.name ? "#{object_id}:#{@_as.name}" : object_id end |
#message!(command, data = nil, source = nil) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/tribe/actable.rb', line 45 def (command, data = nil, source = nil) event = Tribe::Event.new(command, data, source) push_event(event) return nil end |
#name ⇒ Object
74 75 76 |
# File 'lib/tribe/actable.rb', line 74 def name return @_as.name end |
#perform!(&block) ⇒ Object
66 67 68 |
# File 'lib/tribe/actable.rb', line 66 def perform!(&block) return (:perform, block) end |
#shutdown! ⇒ Object
62 63 64 |
# File 'lib/tribe/actable.rb', line 62 def shutdown! return (:shutdown) end |