Skip to content

Hook#133

Draft
maranqz wants to merge 2 commits intomainfrom
hook
Draft

Hook#133
maranqz wants to merge 2 commits intomainfrom
hook

Conversation

@maranqz
Copy link
Copy Markdown
Member

@maranqz maranqz commented Feb 8, 2026

Summary

This PR introduces experimental commit and rollback hooks and transaction metadata (TxInfo) to go-transaction-manager without breaking the existing trm.Transaction API and without requiring a v3 release.

The change is fully opt-in and implemented via a context-carried wrapper (XTransaction), preserving backward compatibility while enabling richer lifecycle instrumentation and control.


Motivation

Many real-world use cases require reacting to transaction lifecycle events:

  • Metrics and tracing
  • Resource cleanup
  • Deferred side effects
  • Debugging and observability

Today, go-transaction-manager provides strong propagation semantics but no official hook mechanism. This PR introduces a minimal, controlled extension that enables:

  • Commit hooks
  • Rollback hooks
  • Transaction metadata (ownership, nesting, propagation)

…while explicitly avoiding any breaking changes.

* migration from golangci-lint v1 to v2
@maranqz maranqz changed the title Hook Draft: Hook Feb 8, 2026
@maranqz maranqz marked this pull request as draft February 8, 2026 20:44
@maranqz maranqz changed the title Draft: Hook Hook Feb 8, 2026
}

func (r *readonlyFuncWithoutTxDecorator) Keys(ctx context.Context, pattern string) *redis.StringSliceCmd {
func (r *readonlyFuncWithoutTxDecorator) Keys(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rollback and add exclude for linter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant