INNER CODE UNIT · Python

__init__

jupyter-server/jupyverse · plugins/file_id/src/fps_file_id/main.py:12

    def __init__(self, name: str, **kwargs):
        super().__init__(name)
        self.config = FileIdConfig(**kwargs)

    async def prepare(self) -> None:
        file_watcher = await self.get(FileWatcher)  # type: ignore[type-abstract]
        self._stop_event0 = Event()
        self._stop_event1 = Event()

        async with _FileId(file_watcher, self.config.db_path, self._stop_event0) as file_id:
            self.put(file_id, FileId)
            self.done()

        self._stop_event1.set()

    async def stop(self) -> None:
        self._stop_event0.set()
        await self._stop_event1.wait()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…