mirror of https://github.com/m-labs/artiq.git
browser,dashboard: fix asyncio loop management
This commit is contained in:
parent
d872c3ab4d
commit
9e8bb3c701
|
@ -83,7 +83,7 @@ class Browser(QtWidgets.QMainWindow):
|
|||
|
||||
self.applets = applets.AppletsDock(self, datasets_sub)
|
||||
smgr.register(self.applets)
|
||||
atexit_register_coroutine(self.applets.stop)
|
||||
atexit_register_coroutine(self.applets.stop, loop=loop)
|
||||
|
||||
self.datasets = datasets.DatasetsDock(
|
||||
datasets_sub, master_host, master_port)
|
||||
|
@ -162,7 +162,7 @@ def main():
|
|||
browser.show()
|
||||
smgr.load()
|
||||
smgr.start()
|
||||
atexit_register_coroutine(smgr.stop)
|
||||
atexit_register_coroutine(smgr.stop, loop=loop)
|
||||
|
||||
if args.select is not None:
|
||||
browser.files.select(args.select)
|
||||
|
|
|
@ -148,7 +148,7 @@ def main():
|
|||
report_disconnect)
|
||||
loop.run_until_complete(subscriber.connect(
|
||||
args.server, args.port_notify))
|
||||
atexit_register_coroutine(subscriber.close)
|
||||
atexit_register_coroutine(subscriber.close, loop=loop)
|
||||
sub_clients[notifier_name] = subscriber
|
||||
|
||||
broadcast_clients = dict()
|
||||
|
@ -156,7 +156,7 @@ def main():
|
|||
client = Receiver(target, [], report_disconnect)
|
||||
loop.run_until_complete(client.connect(
|
||||
args.server, args.port_broadcast))
|
||||
atexit_register_coroutine(client.close)
|
||||
atexit_register_coroutine(client.close, loop=loop)
|
||||
broadcast_clients[target] = client
|
||||
|
||||
# initialize main window
|
||||
|
@ -196,13 +196,13 @@ def main():
|
|||
"port_notify": args.port_notify,
|
||||
"port_control": args.port_control,
|
||||
})
|
||||
atexit_register_coroutine(d_applets.stop)
|
||||
atexit_register_coroutine(d_applets.stop, loop=loop)
|
||||
smgr.register(d_applets)
|
||||
broadcast_clients["ccb"].notify_cbs.append(d_applets.ccb_notify)
|
||||
|
||||
d_ttl_dds = moninj.MonInj(rpc_clients["schedule"])
|
||||
loop.run_until_complete(d_ttl_dds.start(args.server, args.port_notify))
|
||||
atexit_register_coroutine(d_ttl_dds.stop)
|
||||
atexit_register_coroutine(d_ttl_dds.stop, loop=loop)
|
||||
|
||||
d_schedule = schedule.ScheduleDock(
|
||||
rpc_clients["schedule"], sub_clients["schedule"])
|
||||
|
@ -232,7 +232,7 @@ def main():
|
|||
main_window.show()
|
||||
smgr.load()
|
||||
smgr.start()
|
||||
atexit_register_coroutine(smgr.stop)
|
||||
atexit_register_coroutine(smgr.stop, loop=loop)
|
||||
|
||||
# work around for https://github.com/m-labs/artiq/issues/1307
|
||||
d_ttl_dds.ttl_dock.show()
|
||||
|
|
Loading…
Reference in New Issue