Skip to main content

AsyncClient

Overview

Wrap a synology-api instance and expose every public method as async.

All public callable attributes of the wrapped instance are intercepted and re-dispatched via loop.run_in_executor. Non-callable attributes (properties, simple values) are returned as-is.

Supports async with::

async with AsyncClient(fs) as client: await client.get_info()

fs.logout() is called on exit.

Parameters

sync_instance Any
A fully-constructed synology-api instance (e.g. FileStation(...)). The wrapper does not accept a class — instantiate the class first, then wrap it.