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

Extract client handling into Client module #32

Merged
merged 1 commit into from
Jul 19, 2020
Merged

Conversation

dzunk
Copy link
Owner

@dzunk dzunk commented Jul 19, 2020

Closes #22

Extracted class and instance-level management of the Redis client object into a new Client module. The client still defaults to Redis.current, which can be overridden at the class-level for all time series, or provided as an option to the instance for only one series.

Moved argument parsing into the Client module. Args passed to the cmd call will be automatically flattened, compacted, and have Time objects converted to their millisecond timestamp representation. This cleans up a lot of repetitive code at the call sites, and also means that cmd can be called with positional arguments, eliminating an intermediate args array.

Note that the class-level methods like .query_index can only use the class-level client.

Removed the @retention and @uncompressed instance variables.

@dzunk dzunk merged commit 3bf89b2 into master Jul 19, 2020
@dzunk dzunk deleted the client_refactor branch July 19, 2020 02:24
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.

Clean up connection handling and debugging
1 participant