]> kaliko git repositories - python-musicpdaio.git/blob - mpdaio-object.py
Some improvement on ConnectionPool
[python-musicpdaio.git] / mpdaio-object.py
1 import asyncio
2 import timeit
3
4 from mpdaio.client import MPDClient
5
6 async def run_cli():
7     cli = MPDClient()
8     cli.mpd_timeout = 0.1
9     #await cli.connect()
10     #current = await cli.currentsong()
11     #print(current)
12
13     await cli.currentsong()
14     await cli.playlistinfo()
15     await cli.list('artist')
16     #print(await cli.playlistinfo())
17     await cli.close()
18
19 if __name__ == '__main__':
20     asyncio.run(run_cli())
21     asyncio.run(run_cli())
22     #t = timeit.Timer('asyncio.run(run_cli())', globals=globals())
23     #print(t.autorange())
24     with asyncio.Runner() as runner:
25         runner.run(run_cli())
26         runner.run(run_cli())