whylogs.app.utils

Module Contents

Functions

timer_wrap(func, interval, *args, **kwargs)

_do_wrap(func)

async_wrap(func, *args, **kwargs)

param func

the coroutine to run in an asyncio loop

_wait_for_children()

Wait for the child process to complete. This is to ensure that we write out the log files before the parent

Attributes

_NO_ASYNC

_logger

_threads

_timer_threads

whylogs.app.utils._NO_ASYNC = WHYLOGS_NO_ASYNC
whylogs.app.utils._logger
whylogs.app.utils._threads :List[threading.Thread] = []
whylogs.app.utils._timer_threads :List[threading.Thread] = []
whylogs.app.utils.timer_wrap(func, interval, *args, **kwargs)
whylogs.app.utils._do_wrap(func)
whylogs.app.utils.async_wrap(func, *args, **kwargs)
Parameters

func – the coroutine to run in an asyncio loop

Returns

an thread for the coroutine

Return type

threading.Thread

whylogs.app.utils._wait_for_children()

Wait for the child process to complete. This is to ensure that we write out the log files before the parent process finishes