Class: MessageBusDiags

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

Class Method Summary collapse

Class Method Details

.establish_peer_namesObject



14
15
16
# File 'lib/message_bus_diags.rb', line 14

def self.establish_peer_names
  MessageBus.publish "/server-name", channel: "/server-name-reply/#{my_id}"
end

.my_idObject



6
7
8
# File 'lib/message_bus_diags.rb', line 6

def self.my_id
  @my_id ||= "#{Discourse.os_hostname}-#{Process.pid}"
end

.seen_host(name) ⇒ Object



10
11
12
# File 'lib/message_bus_diags.rb', line 10

def self.seen_host(name)
  @host_info[name] = DateTime.now
end

.seen_hostsObject



18
19
20
# File 'lib/message_bus_diags.rb', line 18

def self.seen_hosts
  @host_info
end