   ([size]
    (Executors/newFixedThreadPool size)))
 
+
 (defn create-wait-pool
   []
   (Executors/newCachedThreadPool))
+
 
 (defn create-schedule-pool
   ([]

  8)

(defn schedule-pool-size
  [system]
  ;; TODO: Find the optimal number for the schedule size
  8)

(defn create-execution-pool
  ([]

  (execute-in (impl/wait-pool system) f))

(defn schedule-with-system
  [system delay f]
  (.schedule (impl/schedule-pool system) f delay TimeUnit/MILLISECONDS))

(defn schedule-fixrate-interval-with-system
  "Executes the given `f` periodically with the given `delay` regardless
  of the termination of the tasks and.

  It schedules the jobs on the schedule threadpool of the given `system`."
  [system delay f]
  (.scheduleAtFixedRate (impl/schedule-pool system)
                        f
                        0
                        delay
                        TimeUnit/MILLISECONDS))

(defn schedule-interval-with-system
  "Executes the given `f` periodically with the given `delay` between
  the termination of one execution and the commencement of the next.

  It schedules the jobs on the schedule threadpool of the given `system`."
  [system delay f]
  (.scheduleWithFixedDelay (impl/schedule-pool system)
                           f
                           0
                           delay
                           TimeUnit/MILLISECONDS))
