소스 검색

add sample program testing if a directory can be watched

main
John-Mark Gurney 4 년 전
부모
커밋
9e082a8487
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. +14
    -0
      misc/kqdir.py

+ 14
- 0
misc/kqdir.py 파일 보기

@@ -0,0 +1,14 @@
import aiokq
import asyncio
import os

fd = os.open('.', os.O_RDONLY)

async def foo():
async with aiokq.watch_file(fd) as wf:
print('a')
await wf()
print('b')

loop = asyncio.get_event_loop()
loop.run_until_complete(foo())

불러오는 중...
취소
저장