               clock (:clock st)]
           (swap! state (fn [st] (-> st (assoc :status :running
                                               :scheduled-future (schedule-next
-                                                                 clock
                                                                  (first timeline)
-                                                                 executor
-                                                                 #(callback state timeline clock trigger executor promise)))))))
+                                                                 {:clock clock
+                                                                  :executor executor
+                                                                  :callback #(callback state timeline {:clock clock :trigger trigger :executor executor :promise promise})}))))))
+
         :ok)))
 
   (stop [_]

  ([colls]
   (merge-timelines compare colls)))

(defn schedule-next [clock next-time executor cb]
  (when next-time
    (let [dly (.until (.instant clock) next-time ChronoUnit/MILLIS)]
      (.schedule executor ^Callable cb dly TimeUnit/MILLISECONDS))))

(defn callback [state timeline clock trigger executor promise]
  (let [[due next-timeline] (split-with #(not (.isAfter (.toInstant %) (.instant clock))) timeline)]

    (if-not (empty? next-timeline)

           :status :running
           :timeline timeline
           :scheduled-future (schedule-next
                              (first timeline)
                              {:clock clock
                               :executor executor
                               :callback #(callback state timeline {:clock clock :trigger trigger :executor executor :promise promise})})
           :clock clock
           :executor executor)
    promise)
