            [com.hazelcast.client HazelcastClient]
            [com.hazelcast.client.impl HazelcastClientProxy]
            [com.hazelcast.client.config ClientConfig]
+           [com.hazelcast.config GroupConfig]
            [com.hazelcast.instance HazelcastInstanceProxy]))
 
 (defn new-instance 

  ([conf]
    (Hazelcast/getOrCreateHazelcastInstance conf)))

(defn client-config [{:keys [hosts retry-ms retry-max]}]
  (let [config (ClientConfig.)]
    (doto config 
      (.getNetworkConfig)
      (.addAddress (into-array hosts))
      (.setConnectionAttemptPeriod retry-ms)
      (.setConnectionAttemptLimit retry-max))
    config))

(defn instance-active? [instance]

  default-client-config
  {:hosts ["127.0.0.1"]
   :retry-ms 5000
   :retry-max 720000
   :group-name "dev"
   :group-password "dev-pass"})                        ;; 720000 * 5000 = one hour

(defonce c-instance (atom nil))

