django / asgiref

ASGI specification and utilities
https://asgi.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1.46k stars 207 forks source link

Allow Local instances to be cleared without deleting #385

Open ababic opened 1 year ago

ababic commented 1 year ago

Greetings, lovely people!

I'm in the process of using Local in a couple of projects, and recently had a case where I wanted to clear cached values based on certain signals, without deleting the object completely.

I'm sure you'll agree the changes are super simple, but I feel this tiny change brings the API more in-line with other familiar cache options, and may help with adoption.

Thank you for all the wonderful work so far, folks.

andrewgodwin commented 1 year ago

I like the idea, but like anything that touches Local, it looks like the tests need a bit more attention!

ababic commented 1 year ago

Thanks @andrewgodwin. I was previously relying on the CI to see test results, but I'll get things setup here properly and ensure tests are all ship-shape before requesting a review.