type

AfterCommitDispatcher

Choose how hooks run after their transaction commits.

Example

go
type InlineDispatcher struct{}

func (InlineDispatcher) Dispatch(
  ctx context.Context,
  effect ridu.AfterCommitEffect,
) error {
  return effect.Run(ctx)
}

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

Related guides