flow.cfg: In Config_manager doc header suggest a strategy for applications for handling dynamic update requests. #73
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
from-akamai-pre-open
Issue origin is Akamai, before opening source
Filed by @ygoldfeld pre-open-source:
Class template Config_manager doc header has a section "Relationship with the rest of your program/threads."
It should suggest an ordering of things. Something like:
** Create Updater. Have it read baseline (apply_static_and_dynamic(B)) from file B; and possibly initial-dynamic (apply_dynamic(D)) from file D.
** Create and start each module M. Before M starts its threads, it must register_dynamic_change_listener() if relevant. Inside this listener, usually, true handling would be post()ed onto M's threads.
** Start Updater thread. When update signal comes in, call apply_dynamic(D) from that thread.
** SIGTERM/etc. happens. Then:
** Stop Updater thread. Once it is stopped, proceed:
** Stop each module M (stop its threads).
** Destroy modules M.
** Destroy Updater.
** Registration of listeners occurs before Updater can apply_dynamic().
** Listeners and their owners are fully alive until after the very last moment apply_dynamic() can still be called.
** Explicit unregistration of listeners is not necessary.
** Startup and shutdown are symmetrical.
Also, look through suggestions in existing comments about when to call unregister...(); it says stuff about "SHOULD" which is not really consistent with the above.
Lastly, make some suggestions about:
The text was updated successfully, but these errors were encountered: