Storage accept callback for atomic operation
If i want implement apcu by IStorage then apcu has own atomic method, whose works fine. But interface of IStorage does not allow use callback for apcu_entry.
For this moment locking solves cache and i can't to use native lock from strorage. Same problem is with redis where in implementation is useful callback.
I understand this is probably BC break. I try to create implementation where i add new interfaces ISelfLock, ISimpleStorage and IStorage has still same api.
I made little test where files blocking concurrent processes while apcu with ISelfLock does not do it.
Here is other info (in czech)
Do you know how it works in Redis?
I didn't implement, but @forrest79 could you describe it?
I think, that Redis is not corresponding to this issue. We just implemented passive locking via SETNX and BLPOP (something like this https://github.com/ionelmc/python-redis-lock in PHP) but it's sometimes crashed under heavy load.
So for redis is best solution lock() & release()
I thing yes. But what is describing h4kuna can be really handy. On smaller sites, I'm using APCu as cache and I want to use build-in atomic fetch method, but it means, that I can't use Nette/Cache
I understand that, but I needed to verify info about Redis.
I don't know about Redis cache/lock, that is not comatible with current Cache implementation.