proposal - `region.key_mangled` or make key_mangler an API method

Issue #100 resolved
created an issue

I recently realized that there is no documented way to get a mangled key out of a region.

dogpile will conditionally mangle a given key using an internally defined 'self.key_mangler' (which could be from a user or backend)

in order find out what key dogpile is eventually caching to, one would need to do something like this:

key_mangled = region.key_mangler(key) if region.key_mangler else key

the problem with this, is that key_mangler is only documented as a configuration parameter -- not an API method -- so it is possible to break in future releases (not likely, but possible).

so my proposal is to either:

  1. document/lock key_mangler as an API method of the region class or
  2. add a key_mangled() function that just runs a key through a mangler if defined.

Comments (3)

  1. Log in to comment