1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-10 05:30:45 -08:00

Synchronously decode as much of the telemetry stream as possible before launching the gui, so that errors can be emitted before creating the window.

Copied from Perforce
 Change: 194303
This commit is contained in:
Gareth Rees 2018-06-29 10:07:21 +01:00
parent 07dfb53f25
commit 249ff09f2a

View file

@ -599,10 +599,14 @@ def main():
with open(args.telemetry, 'rb') as telemetry_file:
event_queue = queue.Queue()
model = Model(event_queue)
decoder = telemetry_decoder(telemetry_file.read)
for batch in decoder():
event_queue.put(batch)
model.update()
stop = threading.Event()
def decoder_thread():
decoder = telemetry_decoder(telemetry_file.read)
while not stop.isSet():
for batch in decoder():
if stop.isSet():
@ -611,7 +615,6 @@ def main():
thread = threading.Thread(target=decoder_thread)
thread.start()
model = Model(event_queue)
qapp = QtWidgets.QApplication([])
app = ApplicationWindow(model, args.telemetry)
app.show()