def _run(idx: int, EngineClass: type, options: Dict[(str, str)], signaling_queue: Queue, fname: str, *args):
    with EngineClass(**options) as s:
        try:
            local_res = getattr(s, fname)(*args)
        except Exception as ex:
            signaling_queue.put((idx, ex))
            return
        signaling_queue.put((idx, local_res))
def _run(idx: int, EngineClass: type, options: Dict[(str, str)], signaling_queue: Queue, fname: str, *args):
    with EngineClass(**options) as s:
        try:
            local_res = getattr(s, fname)(*args)
        except Exception as ex:
            signaling_queue.put((idx, ex))
            return
        signaling_queue.put((idx, local_res))