In most document stores, we establish a connection with some resource but never explicitly close it or destroy it; most of the clients we wrap in our document stores (e.g., ElasticSearch, Mongo, Chroma, etc.) have an init()/connect() and also a close() method.
We could add a method that is triggered when the doc store is destroyed (e.g., based on del), and then release all the allocated resources and established connections.
For more controlled cleanup, we can also consider adding an explicit close() method that users can call when they're done with the document store.
In most document stores, we establish a connection with some resource but never explicitly close it or destroy it; most of the clients we wrap in our document stores (e.g., ElasticSearch, Mongo, Chroma, etc.) have an
init()/connect()and also aclose()method.We could add a method that is triggered when the doc store is destroyed (e.g., based on del), and then release all the allocated resources and established connections.
For more controlled cleanup, we can also consider adding an explicit
close()method that users can call when they're done with the document store.