MCPcopy Index your code
hub / github.com/riverqueue/river / SharedTx

Struct SharedTx

internal/riverinternaltest/sharedtx/shared_tx.go:28–31  ·  view source on GitHub ↗

SharedTx can be used to wrap a test transaction in cases where multiple callers may want to access it concurrently during the course of a single test case. Normally this is not allowed and an access will error with "conn busy" if another caller is already using it. This is a test-only construct bec

Source from the content-addressed store, hash-verified

26// encountered by use of concurrent accesses will be more difficult to debug
27// than otherwise, so it's better to not go there at all if it can be avoided.
28type SharedTx struct {
29 inner pgx.Tx
30 wait chan struct{}
31}
32
33func NewSharedTx(tx pgx.Tx) *SharedTx {
34 wait := make(chan struct{}, 1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected