boltdb/bolt — pull request #118 by benbjohnson (2014-04-04 14:03:26+00:00)
Title: Add Tx.OnCommit() handler.

This commit adds the ability to execute a function after a transaction has successfully committed:

```go
db.Update(func(tx *Tx) error {
fmt.Println("tx started.")
tx.OnCommit(func() {
fmt.Println("tx committed!")
})
fmt.Println("tx almost done...")
return nil
})

// Output:
// tx started.
// tx almost done...
// tx committed!
```

---

I needed this feature for the second time today so I'm adding it in.