From 5a3dffb77dddac5862850594c2bc04e03c007c1e Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Thu, 21 Mar 2019 10:56:27 +0100 Subject: [PATCH] Add SimpleEngine.communicate --- chess/engine.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chess/engine.py b/chess/engine.py index 6f09b2831..ec825f2d4 100644 --- a/chess/engine.py +++ b/chess/engine.py @@ -2222,6 +2222,12 @@ def _get(): future = asyncio.run_coroutine_threadsafe(_get(), self.protocol.loop) return future.result() + def communicate(self, command_factory): + with self._not_shut_down(): + coro = self.protocol.communicate(command_factory) + future = asyncio.run_coroutine_threadsafe(coro, self.protocol.loop) + return future.result() + def configure(self, options): with self._not_shut_down(): coro = asyncio.wait_for(self.protocol.configure(options), self.timeout)