Closed gitleet closed 7 years ago
Hello,
I am using shade in a play application. I am currently using a singleton for my cache instance:
val cache = Memcached(...)
Is it ok to use it like this?
And when my application ends, I will then call cache.close? Is this the best practise?
You should definitely call close() to cleanup when your Play app shuts down. I think the best way to do it is via ApplicationLifecycle (see the official docs)
close()
ApplicationLifecycle
That is what I am doing, just confirming thanks!
Hello,
I am using shade in a play application. I am currently using a singleton for my cache instance:
Is it ok to use it like this?
And when my application ends, I will then call cache.close? Is this the best practise?