clj-rethinkdb
clj-rethinkdb copied to clipboard
Modify structure of Connection record
trafficstars
I'm interested in peoples thoughts about modifying the structure of the Connection record.
From #50:
There's two things we could do to make this kind of bug not happen in the future:
- Move the close function inside the Connection. People should be able to call close and this will use the close method on the Connection. However in my limited testing this doesn't seem to be happening. I'm not quite sure why, I thought records defined their methods as functions in the ns they were defined in.
- Give the connection many fields, rather than putting them all inside a single conn variable. The only things that need to be in the atom are :waiting and :token, so they could go into atoms. The other Java objects are already mutable, and
:dbprobably shouldn't be mutable.
https://github.com/apa512/clj-rethinkdb/pull/50#issuecomment-117531605