interface

AfterCommitDispatcher

Choose how hooks run after their transaction commits.

Properties

PropertyTypeDescription
Dispatchfunc(context.Context, AfterCommitEffect) errorDeliver one effect after its transaction commits.

Returns

A delivery error that cannot roll back committed content.

error

How it works

Without a custom dispatcher, AfterCommit hooks run synchronously. A dispatcher must call effect.Run or arrange for it to run; a Go callback is not itself a durable task.

Full signature

type AfterCommitDispatcher interface { Dispatch(context.Context, AfterCommitEffect) error }

Source core/hook.go:112

Related guides