You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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 fordecr
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 likeCachex.incr(:my_cache, "key", via: :decr)
, it notifies using{ :decr, "key" }
(overriding the function name).The text was updated successfully, but these errors were encountered: