longtasks/test/server.py
2025-11-05 14:06:52 +08:00

14 lines
330 B
Python

import asyncio
from appPublic.worker import get_event_loop
from longtasks.longtasks import LongTasks
if __name__ == '__main__':
async def main(lt):
while True:
await asyncio.sleep(10)
lt = LongTasks('redis://127.0.0.1:6379', 'test')
loop = get_event_loop()
loop.create_task(lt.run())
loop.run_until_complete(main(lt))