28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/sps_messenger.rb', line 28
def start(watchx: false, pub_host: 'sps', pub_port: '59000',
client_id: Socket.gethostname)
Curses.init_screen
x = 0
y = Curses.lines / 2
Curses.setpos(y, x)
curs_set(0)
start_color
init_pair(COLOR_GREEN, COLOR_GREEN,COLOR_BLACK)
init_pair(COLOR_YELLOW,COLOR_YELLOW,COLOR_BLACK)
attron(color_pair(COLOR_GREEN)|A_NORMAL){ addstr('ready ') }
refresh()
Thread.new { watch_xset(pub_host, pub_port, client_id) } if watchx
subscribe(topic: 'messenger | ' + client_id + '/messenger')
end
|