There are a few cases where redislite instances are useful to spin up during the execution of a script, and then make sure they're cleared up afterwards (tests etc.). One can manually shutdown the server and/or del the instance, which can be done in a try/except to be error-tolerant, but this is a perfect use case for a context manager which would call _cleanup on __exit__.
There are a few cases where redislite instances are useful to spin up during the execution of a script, and then make sure they're cleared up afterwards (tests etc.). One can manually
shutdown
the server and/ordel
the instance, which can be done in a try/except to be error-tolerant, but this is a perfect use case for a context manager which would call_cleanup
on__exit__
.It could be as simple as adding
Although we'd probably want to make sure we didn't cleanup/ shutdown a server we didn't start.
Somewhat related to #97