commit

package
v0.0.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package commit runs actions after the surrounding transaction commits: effects outside the database (a cache invalidation) must not be observed before the change they describe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func After

func After(ctx context.Context, fn func(context.Context))

After defers fn until the surrounding scope commits; outside any scope there is nothing to wait for and fn runs at once.

func Scope

func Scope(ctx context.Context, run func(ctx context.Context) error) error

Scope runs fn as a transaction body: actions deferred inside it run after fn and the commit succeed. A nested scope joins the outer one, so its actions wait for the outermost commit.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL