Skip to content

Commit

Permalink
Add SimpleEngine.communicate
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Mar 21, 2019
1 parent aef388c commit 5a3dffb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chess/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5a3dffb

Please sign in to comment.