     (let [body (read-request-body request)]
         (if body
             (json/read-str body :key-fn clojure.core/keyword))))
+
+(defn clone-or-fetch-bare-repo
+    [repository-url]
+    (log/info "Cloning or fetching bare repository" repository-url)
+    )
+
+(def actions (java.util.concurrent.LinkedBlockingQueue.))
+
+(defn action-consumer
+    []
+    (log/info "Starting actions consumer")
+    (future                                    ; start consumer in its own thread
+        (while true
+            (when-let [action (.take actions)] ; blocking operation
+                (log/info "Got action for repository" action)
+                (clone-or-fetch-bare-repo action)
+            ))))
+
+(defn new-action
+    [action]
+    (.put actions action))
 
 (def empty-SHA "0000000000000000000000000000000000000000")
 

        (log/info "before"     before)
        (log/info "after"      after)
        (log/info "operation"  operation)
        ))

        

(defn http-request-handler
    "Handler that is called by Ring for all requests received from user(s)."

(defn -main
    "Entry point to the branch handler service server."
    [& args]
    (log/info "Started app on port" port)
    (action-consumer)
    (start-server ring-app port))

