File: queue_status.py

package info (click to toggle)
panoramisk 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 604 kB
  • sloc: python: 1,557; makefile: 133; sh: 28
file content (24 lines) | stat: -rw-r--r-- 598 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import asyncio
from panoramisk import Manager
from pprint import pprint


async def queue_status():
    manager = Manager(loop=asyncio.get_event_loop(),
                      host='127.0.0.1', port=5039,
                      username='username', secret='mysecret')
    await manager.connect()
    queues_details = await manager.send_action(
        {'Action': 'QueueStatus', 'Queue': 'queue_name'})
    manager.close()
    pprint(queues_details)


def main():
    loop = asyncio.get_event_loop()
    loop.run_until_complete(queue_status())
    loop.close()


if __name__ == '__main__':
    main()