 (defn new-task-information [peer task]
   (map->TaskInformation (select-keys (merge peer task) [:log :job-id :task-id :id])))
 
-;; Publisher heartbeats
-;; At the start of each cycle, set all publications to used? false
-;; Whenever you send a message / barrier / whatever to a publication, set used? true
-;; At the end of the cycle, send heartbeats to used? false publications
-;; Make all of this done by the messenger
-
-;; Subscriber heartbeats
-;; At the end of each cycle, check whether subscriber is still alive
-;; If it is not, do not send a message and consider re-establishing via log message / peer reboot
-;; If it is, then send a heartbeat in the backchannel to the publisher
-
-;; TODO, try to filter out lifecycles that are actually identity
 (defn filter-task-lifecycles 
   [{:keys [onyx.core/task-map onyx.core/windows onyx.core/triggers] :as event}]
   (let [task-type (:onyx/type task-map)

        subscriber (m/subscriber (get-messenger state))] 
    (set-output-pipeline! state pipeline)
    (if advance?
      ;(assert (not (empty? (sub/src-peers (m/subscriber messenger)))) (get-replica state))
      (cond-> (next-epoch! state)

        (and (sub/completed? subscriber) 

                replica-version
                :e
                epoch
                :n-pubs
                (count (m/publishers messenger))
                :batch
