Module: Tribe::Actable

Includes:
Workers::Helpers
Included in:
Actor
Defined in:
lib/tribe/actable.rb

Instance Method Summary collapse

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

#identifierObject



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 message!(command, data = nil, source = nil)
  event = Tribe::Event.new(command, data, source)

  push_event(event)

  return nil
end

#nameObject



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 message!(:perform, block)
end

#shutdown!Object



62
63
64
# File 'lib/tribe/actable.rb', line 62

def shutdown!
  return message!(:shutdown)
end