class Legion::Extensions::Node::Transport::Messages::Beat
Public Instance Methods
encrypt?()
click to toggle source
# File lib/legion/extensions/node/transport/messages/beat.rb, line 15 def encrypt? false end
expiration()
click to toggle source
# File lib/legion/extensions/node/transport/messages/beat.rb, line 11 def expiration 5000 end
message()
click to toggle source
# File lib/legion/extensions/node/transport/messages/beat.rb, line 19 def message hash = { name: Legion::Settings[:client][:hostname], pid: Process.pid, timestamp: Time.now } hash[:status] = @options[:status].nil? ? 'healthy' : @options[:status] hash end
routing_key()
click to toggle source
# File lib/legion/extensions/node/transport/messages/beat.rb, line 3 def routing_key 'status' end
type()
click to toggle source
# File lib/legion/extensions/node/transport/messages/beat.rb, line 7 def type 'heartbeat' end
validate()
click to toggle source
# File lib/legion/extensions/node/transport/messages/beat.rb, line 25 def validate raise 'status should be a string' unless @options[:status].is_a?(String) || @options[:status].nil? @valid = true end