From 976602f3d3d6cd22c7357821117a14b67d9edf46 Mon Sep 17 00:00:00 2001 From: VG Date: Mon, 14 Mar 2016 17:11:31 +0100 Subject: wip --- tests/wqueue2.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/wqueue2.py b/tests/wqueue2.py index d53da36..a78f315 100755 --- a/tests/wqueue2.py +++ b/tests/wqueue2.py @@ -10,6 +10,7 @@ async def test(): async def manage_client(reader, writer): + print('='*40) print('manage_client created') print('called on connection only ?') await asyncio.sleep(1) @@ -20,6 +21,22 @@ async def manage_client(reader, writer): break print('line', line) writer.write(line) + writer.close() + print('end of manage_client') + + +async def manage_jobs(): + queue = [] + while True: + async with open('queue.txt') as f: + line = await next(f) + if not line: + # schedule new job + print('executing next scheduled job') + +def read_next_job_arg(): + with open(QUEUE_FILE, 'r') as f: + line = f.readline() def main(): -- cgit v1.2.3