From 0edb696c997117f1a96805a11c67ec598ec07bb9 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 15 Jun 2020 10:11:50 +0100 Subject: [PATCH] Switched file IO to greenlet --- openflexure_microscope/captures/capture.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openflexure_microscope/captures/capture.py b/openflexure_microscope/captures/capture.py index 8266d489..574b6919 100644 --- a/openflexure_microscope/captures/capture.py +++ b/openflexure_microscope/captures/capture.py @@ -12,7 +12,6 @@ import atexit from gevent.fileobject import FileObjectThread import gevent -import threading from collections import OrderedDict @@ -172,7 +171,7 @@ class CaptureObject(object): def flush(self): logging.debug(f"Flushing {self.file}") - gevent.get_hub().threadpool.spawn(self._stream_to_file) + gevent.spawn(self._stream_to_file) logging.debug(f"Returning flushing {self.file}") def open(self, mode):