Skip to main content

Module reload

Module reload 

Source
Expand description

Config hot-reload.

Watches the config file and, on change, rebuilds the Runtime and atomically swaps it into the live ArcSwap. Because only the policy snapshot is replaced — never the listener or the connection pool — in-flight requests finish under the policy they started with and no connections are dropped. A reload that fails to parse/validate is logged and the previous runtime is kept, so a typo can never take the proxy down.

Functions§

watch
Watch path and hot-reload on every change. Runs until the channel closes; spawn it as a background task. path is the config file the binary was started with.