Skip to content

Commit

Permalink
Document engine usage with AsyncSSH
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Feb 9, 2019
1 parent 1758118 commit 29fcab1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/engine.rst
Expand Up @@ -358,6 +358,30 @@ when submitting bug reports.
# Enable debug logging.
logging.basicConfig(level=logging.DEBUG)
AsyncSSH
--------

:class:`~chess.engine.EngineProtocol` can also be used with
`AsyncSSH <https://asyncssh.readthedocs.io/en/latest/>`_ (currently requires
``develop`` branch).

.. code:: python
import asyncio
import asyncssh
import chess
import chess.engine
async def main():
async with asyncssh.connect("localhost") as conn:
channel, engine = await conn.create_subprocess(chess.engine.UciProtocol, "stockfish")
await engine.initialize()
# Play, analyse, ...
await engine.ping()
asyncio.run(main())
Reference
---------

Expand Down

0 comments on commit 29fcab1

Please sign in to comment.