Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterCommit ¶ added in v0.5.0
AfterCommit registers fn on the current transaction attempt. If no scope is active, fn runs immediately so callers remain safe outside retrying stores.
Types ¶
type AfterCommitScope ¶ added in v0.5.0
type AfterCommitScope struct {
// contains filtered or unexported fields
}
AfterCommitScope collects effects that must run only after the surrounding datastore transaction commits. A new scope is required for every retry attempt so effects registered by an aborted attempt are discarded.
func WithAfterCommitScope ¶ added in v0.5.0
func WithAfterCommitScope(ctx context.Context) (context.Context, *AfterCommitScope)
WithAfterCommitScope attaches a fresh after-commit scope to ctx.
func (*AfterCommitScope) Run ¶ added in v0.5.0
func (s *AfterCommitScope) Run(ctx context.Context)
Run executes the actions registered by the committed transaction attempt.