hot reloading support #6

Merged
mossfet merged 3 commits from hot-reloading into main 2023-07-04 14:26:42 +00:00
Member

this pull request adds hot reloading support which let's you edit the names.json file while the server is running and it will read the config into the global state and the server will have access to the new data.

this is implemented with a global state using a OnceLock and a Mutex and the notify crate. the notify crate is running in another thread that allows blocking.

this pull request adds hot reloading support which let's you edit the names.json file while the server is running and it will read the config into the global state and the server will have access to the new data. this is implemented with a global state using a OnceLock and a Mutex and the notify crate. the notify crate is running in another thread that allows blocking.
Fries added 3 commits 2023-07-04 05:48:05 +00:00
im sorry if you have to look at the sites.rs file.
looks like the best way to do the state thing after all is global so i
should use async mutexes so stuff doesn't block.
this means the watcher doesn't stop working if someone makes an edit to
names.json that results in a parser error. it will just print out the
error and keep the old configuration. if you restart the program and the
file still has an error, the program won't start.
mossfet merged commit ec9d5cd874 into main 2023-07-04 14:26:42 +00:00
mossfet deleted branch hot-reloading 2023-07-04 14:35:22 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Solarpunk/meowy-webring#6
No description provided.