import asyncio from apscheduler.schedulers.asyncio import AsyncIOScheduler async def job(): print('Hello, world!') scheduler = AsyncIOScheduler() scheduler.add_job(job, 'interval', seconds=1) scheduler.start() loop = asyncio.get_event_loop() loop.run_forever()
jobs = scheduler.get_jobs() for job in jobs: print(job)This will print out all the scheduled jobs along with their next execution time and any additional parameters. Overall, the `AsyncIOScheduler` class is a useful tool for scheduling asynchronous jobs in Python using the `asyncio` library.