# Path: il2fb/ds/airbridge/typing.py



import io
import logging
import threading
import time
from pathlib import Path
from os import stat_result
from ddict import DotAccessDict
from il2fb.ds.airbridge.typing import StringHandler, StringOrPath
            self._do_stop = True

    def run(self) -> None:
        try:
            LOG.info(f"watch dog for text file `{self._path}` was started")
            self._run_with_retries()
        except StopWatchDog:
            LOG.info(f"watch dog for text file `{self._path}` was stopped")
        except Exception:
            LOG.error(f"watch dog for text file `{self._path}` was terminated")
            raise

    def _run_with_retries(self) -> None:
        while True:
            self._maybe_stop()

            try:
                self._try_to_run()
            except FileNotFoundError:
                self._clear_state()
                continue

    def _try_to_run(self) -> None:
        if self._path.exists():
            self._reset_state_if_file_was_recreated()
        else:
            self._clear_state()
            self._wait_for_file_to_get_created()

        if (self._state.device is None) or (self._state.inode is None):

# Path: il2fb/ds/airbridge/typing.py



# Path: il2fb/ds/airbridge/watch_dog.py
import io
import logging
import threading
import time
from pathlib import Path
from os import stat_result
from ddict import DotAccessDict
from il2fb.ds.airbridge.typing import StringHandler, StringOrPath

            self._do_stop = True

    def run(self) -> None:
        try:
            LOG.info(f"watch dog for text file `{self._path}` was started")
            self._run_with_retries()
        except StopWatchDog:
            LOG.info(f"watch dog for text file `{self._path}` was stopped")
        except Exception:
            LOG.error(f"watch dog for text file `{self._path}` was terminated")
            raise

    def _run_with_retries(self) -> None:
        while True:
            self._maybe_stop()

            try:
                self._try_to_run()
            except FileNotFoundError:
                self._clear_state()
                continue

    def _try_to_run(self) -> None:
        if self._path.exists():
            self._reset_state_if_file_was_recreated()
        else:
            self._clear_state()
            self._wait_for_file_to_get_created()

        if (self._state.device is None) or (self._state.inode is None):

            stat = self._get_actual_stat()