reactive.lock

reactive.lock()

A lock that should be held whenever manipulating the reactive graph.

For example, lock makes it safe to set a value and call flush from a different Task than the one that is running the Shiny Session.