forked from Houston4444/RaySession
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitor_capability_api
62 lines (38 loc) · 2 KB
/
monitor_capability_api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
The ':monitor:' capability allows an NSM client to get informations from the NSM server about other clients in the session.
To become a monitor client, the client MUST check if the NSM server has the ':monitor:' capability, and its capability string MUST contain ':monitor:'.
Just before receiving the first /nsm/client/open message, the monitor client will receive for each client in the session the following status message:
/nsm/client/monitor/client_state s:client_id i:is_started
'is_started' is 1 if the client is started or 0 if the client is stopped.
A monitor client can query the state of the other clients at any time by sending this message to the server
/nsm/server/monitor_reset
At each event, this monitor client will receive :
/nsm/client/monitor/client_event s:client_id s:event
where 'event' can be
started
joined
ready
saved
stopped_by_server
stopped_by_itself
removed
open_error
save_error
start_request
save_request
stop_request
the 'joined' event happens when a client is started from the outside, for example when it is started from the shell with the command `NSM_URL=server_url executable`.
in RaySession, the 'removed' event happens when a client is definitely removed from the trash.
Note that a monitor client does not receives /nsm/client/monitor_event if the event
concerns this monitor client.
-------------------------------------
In RaySession, there is also the possibility for an external program to become a monitor.
This allows to get informations on the session clients and be warned of clients events without being a session client.
The program becomes a ray-daemon monitor with:
/ray/server/monitor_announce
it MUST send to server the following message before to be stopped:
/ray/server/monitor_quit
It will receives the same messages than a monitor client, but for logical reasons,
'/nsm/client/monitor/' is substitued with '/ray/monitor/' in paths.
it receives client states and events at
/ray/monitor/client_state s:client_id i:is_started
/ray/monitor/client_event s:client_id s:event