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

Multiple queued commands during watch #76

Merged
merged 3 commits into from
Nov 21, 2014

Conversation

iksteen
Copy link
Contributor

@iksteen iksteen commented Nov 21, 2014

When MULTI has not been called on a transaction yet, post_proc should be treated as it would be without a transaction.

Below is an example where post_proc won't be called. The result of hgetall will not be a dictionary:

t = yield db.watch(['foo'])
a, b = yield defer.gatherResults([
    t.hgetall('bar'),
    t.hgetall('baz'),
])

This pull requests adds a test for this scenario, fixes the handling of post_proc before MULTI is called, and makes commit/discard check if MULTI is called.

hgetall uses post_proc to make a dictionary from the results, check if
it is called while two commands are sent when watching a key but before
starting the multi part of the transaction.
If the connection is in a transaction but multi has not been called
yet, treat post_proc as we would without a transaction.
fiorix added a commit that referenced this pull request Nov 21, 2014
Multiple queued commands during watch
@fiorix fiorix merged commit 537836b into IlyaSkriblovsky:master Nov 21, 2014
@fiorix
Copy link
Collaborator

fiorix commented Nov 21, 2014

Cool, thanks!

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.

2 participants