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

MAINT, ENH, TST: Butler.Memory #217

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

MAINT, ENH, TST: Butler.Memory #217

wants to merge 2 commits into from

Conversation

stsievert
Copy link
Member

This request provides two items:

  • better connection for butler.memory
  • more complete interface to butler.memory
  • cleans the Memory API

The "better connection" means that it does not rely on constants.MINIONREDISHOST. For me that failed. Instead, uses StrictRedis(host='minionredis_1'), which is (as @dconathan mentioned) a somewhat old docker feature that we're not up to date on. @LiamIm did constants.MINIONREDISHOST work for you?

This also adds the functions increment, append, get_many, set_many and pipeline to Butler.Memory. It also refactors set and get to use ast.literal_eval to return the stored objects.

It cleans the API by using function wrappers to ensure the connection and catch exceptions. Before, all of these were coded in every function.

This implementation can be tested in the docker container with

$ sudo docker exec -i -t local_nextbackenddocker_1 /bin/bash
# logs into docker container
$ cd next/apps/tests
$ py.test test_memory.py

All tests pass.

– better connection (no more constants.MINIONREDIS)
– enhanced API (store arbitrary objects, use fn wrappers, get_many,
set_many, append, increment, pipeline)
@stsievert
Copy link
Member Author

The connection change seems independent from what this PR tries to implement, which is why I'm holding off.

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