 
 (defn io-assoc
   ([^String entity-id key value]
-   (tcp-request-responce (io-assoc-base entity-id key value)))
+   (let [callback (chan 1)
+         {:keys [b-a request-uuid]} (io-assoc-base entity-id key value)]
+     (>!! tcp-request-ch {:b-a b-a :request-uuid request-uuid :callback callback})
+     (<!! callback)))
   ([^String entity-id key value callback]
    (let [{:keys [b-a request-uuid]} (io-assoc-base entity-id key value)]
      (>!! tcp-request-ch {:b-a b-a :request-uuid request-uuid :callback callback}))))


(defn io-dissoc
  ([^String entity-id key]
    (tcp-request-responce (io-dissoc-base entity-id key)))
  ([^String entity-id key callback]
   (let [{:keys [b-a request-uuid]} (io-dissoc-base entity-id key)]
     (>!! tcp-responce-ch {:b-a b-a :request-uuid request-uuid :callback callback}))))

(defn io-get-key-as-of
  ([^String entity-id key timestamp]
   (tcp-request-responce (io-get-key-as-of-base entity-id key timestamp)))
  ([^String entity-id key timestamp callback]
   (let [{:keys [b-a request-uuid]} (io-get-key-as-of-base entity-id key timestamp)]
     (>!! tcp-request-ch {:b-a b-a :request-uuid request-uuid :callback callback}))))

(defn io-get-entity-as-of
  ([^String entity-id timestamp]
    (tcp-request-responce (io-get-entity-as-of-base entity-id timestamp)))
  ([^String entity-id timestamp callback]
   (let [{:keys [b-a request-uuid]} (io-get-entity-as-of-base entity-id timestamp)]
     (>!! tcp-request-ch {:b-a b-a :request-uuid request-uuid :callback callback}))))

(defn io-get-all-versions-between
  ([^String entity-id timestamp-start timestamp-end limit]
    (tcp-request-responce (io-get-all-versions-between-base entity-id timestamp-start timestamp-end limit)))
  ([^String entity-id timestamp-start timestamp-end limit callback]
   (let [{:keys [b-a request-uuid]} (io-get-all-versions-between-base entity-id timestamp-start timestamp-end limit)]
     (>!! tcp-request-ch {:b-a      b-a

(defn dispatch-to-type [value]
  (util/serialize value))

(def callback-count (atom 0))

(defn callback-test [responce-data]
