refactoring

This commit is contained in:
Devaev Maxim
2020-05-29 04:33:35 +03:00
parent eb13da03be
commit cf5bf8e147
4 changed files with 40 additions and 14 deletions

View File

@@ -20,7 +20,6 @@
# ========================================================================== #
import os
import asyncio
import asyncio.queues
import functools
@@ -39,9 +38,6 @@ from typing import TypeVar
from typing import Optional
from typing import Any
import aiofiles
import aiofiles.base
from .logging import get_logger
@@ -93,13 +89,6 @@ async def wait_first(*aws: Awaitable) -> Tuple[Set[asyncio.Future], Set[asyncio.
return (await asyncio.wait(list(aws), return_when=asyncio.FIRST_COMPLETED))
# =====
async def afile_write_now(afile: aiofiles.base.AiofilesContextManager, data: bytes) -> None:
await afile.write(data)
await afile.flush()
await run_async(os.fsync, afile.fileno())
# =====
class AioNotifier:
def __init__(self) -> None: