forked from M-Labs/artiq
aqctl_moninj_proxy: clear listeners on disconnect
This commit is contained in:
parent
7aa6104872
commit
c7394802bd
|
@ -116,6 +116,9 @@ class MonitorMux:
|
||||||
else:
|
else:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
|
def disconnect_cb(self):
|
||||||
|
self.listeners.clear()
|
||||||
|
|
||||||
|
|
||||||
class ProxyConnection:
|
class ProxyConnection:
|
||||||
def __init__(self, monitor_mux, reader, writer):
|
def __init__(self, monitor_mux, reader, writer):
|
||||||
|
@ -203,7 +206,9 @@ def main():
|
||||||
signal_handler.setup()
|
signal_handler.setup()
|
||||||
try:
|
try:
|
||||||
monitor_mux = MonitorMux()
|
monitor_mux = MonitorMux()
|
||||||
comm_moninj = CommMonInj(monitor_mux.monitor_cb, monitor_mux.injection_status_cb)
|
comm_moninj = CommMonInj(monitor_mux.monitor_cb,
|
||||||
|
monitor_mux.injection_status_cb,
|
||||||
|
monitor_mux.disconnect_cb)
|
||||||
monitor_mux.comm_moninj = comm_moninj
|
monitor_mux.comm_moninj = comm_moninj
|
||||||
loop.run_until_complete(comm_moninj.connect(args.core_addr))
|
loop.run_until_complete(comm_moninj.connect(args.core_addr))
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue