Schedule a compensating task on the thread local transaction (use within an atomic).
Schedule a compensating task on the thread local transaction (use within an atomic). This is executed when the transaction aborts.
Schedule a deferred task on the thread local transaction (use within an atomic).
Schedule a deferred task on the thread local transaction (use within an atomic). This is executed when the transaction commits.
Use either-orElse to combine two blocking transactions.
STM retry for blocking transactions (use within an atomic).
STM retry for blocking transactions (use within an atomic). Can be used to wait for a condition.
Stm utility methods for scheduling transaction lifecycle tasks and for blocking transactions. Automatically imported with:
Schedule a deferred task on the thread local transaction (use within an atomic). This is executed when the transaction commits.
atomic { deferred { // executes when transaction successfully commits } }Schedule a compensating task on the thread local transaction (use within an atomic). This is executed when the transaction aborts.
atomic { compensating { // executes when transaction aborts } }STM retry for blocking transactions (use within an atomic). Can be used to wait for a condition.
atomic { if (!someCondition) retry // ... }Use either-orElse to combine two blocking transactions.
atomic { either { // ... } orElse { // ... } }