Skip to main content

after_commit

Function after_commit 

Source
pub async fn after_commit<F, Fut>(callback: F) -> Result<(), Error>
where F: FnOnce() -> Fut + Send + 'static, Fut: Future<Output = Result<(), Error>> + Send + 'static,
Expand description

Runs a callback after the current crate::Orm::transaction commits.

If no managed transaction is active, the callback runs immediately. This matches an already committed/autocommit operation. A callback failure is returned as Error::PostCommit, making it explicit that the database write may already be durable.