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

All delegate methods should be forked out inside the cache Worker #8

Closed
whitfin opened this issue Apr 10, 2016 · 0 comments
Closed
Assignees

Comments

@whitfin
Copy link
Owner

whitfin commented Apr 10, 2016

Right now there's a blend of delegates in that some delegate inside the Worker (expire_at/persist) and some delegate in Cachex (decr).

It should be ensured that all of these delegates do take place inside the Worker. It adds a bit of extra and arguably redundant code, but it allows the hook notifications to contain the correct function. As it stands right now, if you call Cachex.decr(:my_cache, "key") your notification becomes { :incr, "key" }, which totally sucks (and is why this is marked as a bug). Anyone listening for decr calls will just never get them.

Alternatively, perhaps we could add a recognisable :from or :via to all the worker functions, so if you call something like Cachex.incr(:my_cache, "key", via: :decr), it notifies using { :decr, "key" } (overriding the function name).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant