Skip to main content

Module monitor

Module monitor 

Source
Expand description

Provides live filesystem monitoring, file-settling checks, and checksum generation.

Uses notify watchers (inotify on Linux, polling under Flatpak) to detect new or modified files in watch-path directories. Files are settled via a debounce window before being queued, and checksums are computed using BLAKE3 with chunked streaming to avoid large allocations.

StructsΒ§

Monitor
File monitor that coordinates watching directories and reporting events.
MonitorHandle

EnumsΒ§

MonitorCommand πŸ”’
Monitor commands passed down the main event loop.
MonitorEvent
MonitorFsEvent πŸ”’

ConstantsΒ§

CHECK_INTERVAL_MS πŸ”’
FLATPAK_POLL_INTERVAL_MS πŸ”’
IDLE_TIMEOUT_SECS πŸ”’
REQUIRED_STABLE_COUNTS πŸ”’
Number of consecutive stable size checks required before a file is considered complete.

FunctionsΒ§

compute_sha1_chunked πŸ”’
Compute SHA-1 in chunks so large media files never need to be read fully into memory.
create_watcher πŸ”’
Create recommended watcher fallback or poll watcher depending on flatpak containerisation.
handle_notify_event πŸ”’
hash_and_emit πŸ”’
is_flatpak_sandbox πŸ”’
Check if running inside Flatpak sandbox environment.
is_supported_media_path πŸ”’
Return whether a path points to a supported media file rather than a directory.
is_temporary_file πŸ”’
monitor_event_kind πŸ”’
process_delete_path πŸ”’
process_upsert_path πŸ”’
replace_watches πŸ”’
Replace live directories being monitored by the given watcher.
should_skip_path πŸ”’
spawn_hash_workers πŸ”’
wait_for_file_completion πŸ”’
Wait for a file’s size to stop changing before treating it as upload-ready.