-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #22 Inited event processor + file cache + started to integrate them into the watcher * #22: Simplified the flow given the processor * #22 Wait until events are received before returning to the python world * #22 Lint py wrappers * #22: Tried to wrap sleeping into the allow_threads * #22: Added a new example * 22: Fixing the termination of the notification process in the async mode * #22 🔖 v0.0.3 * #22 linting
- Loading branch information
1 parent
c71b616
commit 99dbf6c
Showing
13 changed files
with
759 additions
and
167 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import asyncio | ||
import os | ||
from pathlib import Path | ||
|
||
from notifykit import Notifier | ||
|
||
|
||
async def watch(watched_dir: Path) -> None: | ||
notifier = Notifier(debounce_ms=200, debug=True) | ||
|
||
notifier.watch([watched_dir]) | ||
|
||
async for events in notifier: | ||
# process your events | ||
print(events) | ||
|
||
|
||
if __name__ == "__main__": | ||
watched_dir = Path("./watched_dir") | ||
os.makedirs(watched_dir, exist_ok=True) | ||
|
||
asyncio.run(watch(watched_dir)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.