     {:doc "A docstring for this lifecycle."
      :type :string
      :optional? true}}
+
+   :lifecycle-calls
+    {:lifecycle/start-task? {:doc "A function that takes two arguments - an event map, and the matching lifecycle map. Must return a boolean value indicating whether to start the task or not. If false, the process backs off for a preconfigured amount of time and calls this task again. Useful for lock acquisition. This function is called prior to any processes inside the task becoming active."
+                            :type :function
+                            :optional? true}
+    :lifecycle/before-task-start {:doc "A function that takes two arguments - an event map, and the matching lifecycle map. Must return a map that is merged back into the original event map. This function is called after processes in the task are launched, but before the peer listens for incoming segments from other peers."
+                                  :type :function
+                                  :optional? true}
+    :lifecycle/before-batch {:doc "A function that takes two arguments - an event map, and the matching lifecycle map. Must return a map that is merged back into the original event map. This function is called prior to receiving a batch of segments from the reading function."
+                             :type :function
+                             :optional? true}
+    :lifecycle/after-batch {:doc "A function that takes two arguments - an event map, and the matching lifecycle map. Must return a map that is merged back into the original event map. This function is called immediately after a batch of segments has been read by the peer. The segments are available in the event map by the key `:onyx.core/batch`."
+                            :type :function
+                            :optional? true}
+    :lifecycle/after-task-stop {:doc "A function that takes two arguments - an event map, and the matching lifecycle map. Must return a map that is merged back into the original event map. This function is called before the peer relinquishes its task. No more segments will be received."
+                                :type :function
+                                :optional? true}
+    :lifecycle/after-ack-segment {:doc "A function that takes four arguments - an event map, a message id, the return of an input plugin ack-segment call, and the matching lifecycle map. May return a value of any type which will be discarded. This function is whenever a segment at the input task has been fully acked."
+                                  :type :function
+                                  :optional? true}
+    :lifecycle/after-retry-segment {:doc "A function that takes four arguments - an event map, a message id, the return of an input plugin ack-segment call, and the matching lifecycle map. May return a value of any type which will be discarded. This function is whenever a segment at the input task has been pending for greater than pending-timeout time and will be retried."
+                                    :type :function
+                                    :optional? true}}
 
    :peer-config
    {:onyx.peer/inbox-capacity

(defn lifecycle-entry-options []
  (feature-options model :lifecycle-entry))

(defn window-entry-view []
  (feature-view :window-entry))

(defn window-entry-options []
  (feature-options model :window-entry))

(defn trigger-entry-view []
  (feature-view :trigger-entry))

    :window/aggregation
    {:doc "If this value is a keyword, it is a fully qualified, namespaced keyword pointing to a symbol on the classpath at runtime. This symbol must be a map with keys as further specified by the information model. Onyx comes with a handful of aggregations built in, such as `:onyx.windowing.aggregation/min`. See the User Guide for the full list. Users can also implement their own aggregations.

          If this value is a vector, it contain two values: a keyword as described above, and another keyword which represents the key to aggregate over."
     :type [:keyword [:keyword]]
     :optional? false}

