                                                      :fn function/read-input-batch})
       (#{:function :output} task-type)        (conj {:lifecycle :lifecycle/read-batch
                                                      :fn function/read-function-batch})
-      ; (#{:input :function :output} task-type) (conj {:lifecycle :lifecycle/dead-peer-detection
-      ;                                                :fn dead-peer-detection})
       (#{:input :function :output} task-type) (conj {:lifecycle :lifecycle/after-read-batch
                                                      :fn (build-lifecycle-invoke-fn event :lifecycle/after-read-batch)})
       (#{:input :function :output} task-type) (conj {:lifecycle :lifecycle/apply-fn

  (let [base-replica (onyx.log.replica/starting-replica opts)
        lifecycles (filter :fn (filter-task-lifecycles event))
        names (mapv :lifecycle lifecycles)
        _ (info "NAMES" (:onyx.core/task event) names)
        arr #^"[Lclojure.lang.IFn;" (into-array clojure.lang.IFn (map :fn lifecycles))
        recover-idx (int 0)
        iteration-idx (int (lookup-lifecycle-idx lifecycles :lifecycle/next-iteration))

        (do (set! last-heartbeat curr-time)
            (-> this 
                (send-heartbeats!)
                (dead-peer-detection!)))
        this)))
  (print-state [this]
