Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[6.x] Introduce a locking mechanism for the array cache driver #30253
This PR introduces a locking mechanism to the array cache driver, for testing.
It is currently not possible to substitute the array cache driver in tests for any driver that supports locking if your test suite / app relies on the locking functionality.
This PR changes that and is something I've wanted for on projects I work on.
This allows me to run the test suite without having to have a lock supporting cache driver running / setup on my machine - which is nice coming into a project and working on parts of a project that don't interact with the cache locking mechanism because it means I can setup and digging into code faster - and it also means a test environment can be setup without requiring a "real" driver like Redis / memcached to be setup and configured.
It's also nice that once you do go down the path of introducing cache locking into your project, you don't have to also change you testing driver. It just continues to work as expected. Related: #29161
I'm happy to package this up if it isn't something you want to add / maintain in the framework.
I'd love if someone could triple check the expiration tests to make sure my logic is sold there, and I don't need to shift the boundary forward a microsecond
Not that is really matters, because the in memory cache drivers are so fast...but this is faster than, say, memcached. But, like, both are so quick...it isn't going to have a speed impact because the difference is negligible. I just thought I'd mention it.