Support returning time in pipelines #179
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because
now
is defined on theMockRedis
instance itself, it isn't captured in a "future" when capturing the pipelined block.Before this change, the added test would return
['bar', 'baz']
, instead of['bar', [1_546_398_246, 0], 'baz']
.Moving
now
fromMockRedis
toDatabase
was the simplest way to make this work given how the current futures implementation wraps around a database, which makes it cumbersome / non-idiomatic to capture data returned by the server itself.I'm open to suggestions how we can make this more generic (i.e. any method on the server itself is captured, and we don't have to move this method to the database layer), without creating too much coupling between the different parts of the system (I don't think we want to start monkey patching the server within a pipelined scope?).