CloudSqlite.withWriteLock Function
Perform an asynchronous write operation on a CloudContainer with the write lock held.
- if write lock is already held by the current user, refresh write lock's expiry time, call operation and return.
- attempt to acquire the write lock, with retries. Throw if unable to obtain write lock.
- perform the operation
3.a if the operation throws, abandon all changes and re-throw 4. release the write lock. 5. return value from operation
withWriteLock<T>(args: { busyHandler?: CloudSqlite.WriteLockBusyHandler, container: CloudSqlite.CloudContainer, user: string }, operation: () => Promise<T>): Promise<T>
@returns a Promise with the result of operation
Parameter | Type | Description |
---|---|---|
args | { busyHandler?: CloudSqlite.WriteLockBusyHandler, container: CloudSqlite.CloudContainer, user: string } | |
operation | () => Promise<T> | an asynchronous operation performed with the write lock held. |
Returns - Promise<T>
a Promise with the result of operation
Defined in
- core/backend/src/CloudSqlite.ts Line 733
Last Updated: 23 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.