+ # Since TokyoCabinet does not have the concept of an environment, we have to do the
+ # database management ourselves. In particular, we have to keep a list of open
+ # registries to be sure we to close all of them on exit
+ @@bot_registries={ }
+ def self.close_bot_registries
+ @@bot_registries.each { |name, reg| reg.close }
+ @@bot_registries.clear
+ end
+
+ def close
+ db = @@bot_registries.delete(@fname)
+ if db != @db
+ error "We think we have #{@db} from #{@fname}, TC pseudo-env gives us #{db}"
+ end
+ @db.close
+ end
+