Skip to content

Handling app.state changes on db changes #3592

Answered by Alc-Alc
NixBiks asked this question in Q&A
Discussion options

You must be logged in to vote

Can you explain what you mean by "safe manner"? If you mean protection against data races, assignment to state via indexing (state["something"] = "some value") and via attribute (state.something = "somevalue") are protected with a lock making it thread safe. As for "async safe", nothing special has to be done because there is no context switching / async operations inside the setters.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Alc-Alc
Comment options

Answer selected by NixBiks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants