   "Important: This function is not threadsafe and should only be called from a single producer
    The reason is that the .size of the queue is checked, and if enough space .addAll is called,
    otherwise .put is used"
-  [{:keys [^BlockingQueue queue limit]} data-coll]
+  [{:keys [^BlockingQueue queue limit] :as state} data-coll]
   (if (> (.size queue) limit)
     (.addAll queue data-coll)
     (doseq [data data-coll]
-      (.put queue data))))
+      (publish! state data))))
 
 (defn shutdown-pool 
   "Shutdown the ExecutorService used and wait for termination timeout milliseconds, if the threads did not all terminate, the pool is shutdown forcefully"

   by one of the consumer functions
   Returns the pool"
  [pool data]
   (.put ^BlockingQueue (:queue pool) data)
   pool)

(defn bulk-get!

(ns thread-load.core
  (:require [clojure.tools.logging :refer [error debug info]])
  (:import
    [java.util ArrayList]
    [java.util.concurrent BlockingQueue ArrayBlockingQueue Executors ExecutorService TimeUnit ThreadPoolExecutor]
