This was in release notes but way down, so I figured it deserves a special mention here in Developers section. So... singleThreaded is a boolean option that belongs in app/driver definition, with default value of false, meaning apps/drivers behave the way they always did. If set to true, though, hub runs all methods for a particular instance of app/driver sequentially, one at a time. It will load app/driver instance data (including state) run a method, and save the data (including state) completely before moving on to the next method call. This applies to top level methods only and not to calls made by app/driver methods.
definition ( // apps
singleThreaded: true
)
metadata { // drivers
definition (
singleThreaded: true
)
}
This feature has less overead than using atomicState. You can think of app/driver method as running in a single transaction, always committed at the end, even if method threw an exception.