Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transaction Discard/Exec should put the connection back #17

Open
nightlyone opened this issue Jun 24, 2016 · 1 comment
Open

transaction Discard/Exec should put the connection back #17

nightlyone opened this issue Jun 24, 2016 · 1 comment

Comments

@nightlyone
Copy link

Since the connection has been reserved for this purpose only and the Exec documentation even states that it puts the connection back to normal.

Requiring Close feels pretty cumbersome to me.

Please deprecate use of Transaction.Close and make it a no-op after Exec/Discard.

Normal and expected flow for transactions would be:

    t, _ := redis.Transaction()
    _ = transaction.Watch("mykey")
    // work and queue up commands
    if someError {
        _ = t.Discard()
    } else {
        _ = t.Exec()
    }
@xuyu
Copy link
Owner

xuyu commented Jul 8, 2016

A pull request will be appreciate.

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

No branches or pull requests

2 participants