#notify #inotify #reload

really-notify

For when you really, really just want to know that your config changed

1 unstable release

0.1.0 Jun 17, 2023

#10 in #reload

Download history 90/week @ 2024-01-13 2/week @ 2024-01-20 5/week @ 2024-01-27 126/week @ 2024-02-03 99/week @ 2024-02-10 57/week @ 2024-02-17 69/week @ 2024-02-24 68/week @ 2024-03-02 55/week @ 2024-03-09 55/week @ 2024-03-16 87/week @ 2024-03-23 53/week @ 2024-03-30 13/week @ 2024-04-06 12/week @ 2024-04-13 7/week @ 2024-04-20

88 downloads per month
Used in 3 crates

Apache-2.0

27KB
602 lines

really-notify

This crate is for when you really, really just want to know that your config changed. K8s configmap symlink shenanigans? No problem. Multi-level symlink directory & file redirections? Sure. Just tell me my damn config changed.

Inspiration

This crate is a derivation of some code I've been recycling for a while to deal with hot reloading K8s ConfigMaps, which relink the parent dir (accessed through a symlink). I've made it a bit more robust. This is primarily intended for use on Linux/Unix systems, however I've added a backup fallback to notify crate. That won't have the great symlink management the native inotify integration has. notify crate is unable to be configured to deal with symlinks properly.

Similarly, no existing inotify crate (I could find at a cursory glance) had proper async support. They all delegated out to a blocking thread at best, similar to how Tokio deals with files. To integrate with the Tokio network stack, I'm treating the inotify FD as a UNIX pipe receiver, which makes the correct file read syscall, but uses epoll through mio, and not some blocking stuff. Confirmed with strace.

Examples

See examples/ subdirectory.

Dependencies

~3–12MB
~134K SLoC