   ([creds]
    (with-creds creds (Config.)))
   ([{:keys [group-name group-password]} config]
-   (println group-name group-password )
    (let [group-config (GroupConfig. group-name group-password)]
      (condp instance? config
        Config       (.setGroupConfig ^Config config group-config)

    (onResponse [this response]
      (on-response response))))

(defn task [fun & args]
  (let [{:keys [^IExecutorService exec-svc members]} (apply task-args args)]
    (if (= :all members)
      (.executeOnAllMembers exec-svc (Rtask. fun))
      (.execute exec-svc (Rtask. fun)))))

(defn ftask [fun & args]
  (let [{:keys [^IExecutorService exec-svc members callback]} (apply task-args args)]
    (if (= :all members)
      (.submitToAllMembers exec-svc (Ctask. fun))    ;; TODO: add MultiExecutionCallback
      (if callback
        (.submit exec-svc
                 (Ctask. fun)
                 (execution-callback callback))
        (.submit exec-svc
                 (Ctask. fun))))))

(defn mtake [n m]
  (into {} (take n (hz-map m))))

(defn ->mtake [n mname]                 ;; for clients
  @(ftask (partial mtake n mname)))

;; to be a bit more explicit about these tasks (their futures) problems

     ci
     (try
       (info "connecting to: " (secrefy conf))
       (reset! c-instance (HazelcastClient/newHazelcastClient (client-config conf)))
       (catch Throwable t
         (warn "could not create hazelcast a client instance: " t))))))

