 (def garbage-hack "I hate this")
 
 (defn scheduler
+  [pending running]
   []
-  (let [pending (atom #{1 2})
-        used-hosts (atom #{})
+  (let [used-hosts (atom #{})
         ;;this contains pairs of [executor-id slave-id]
         active-executors (atom #{})
         executor-id->hostname (atom {})]

(comment
  (try
    (clj-mesos.marshalling/map->proto org.apache.mesos.Protos$ContainerInfo {:type :docker
                                                                    :docker "rtward/riak-mesos"
                                                                    :volumes [{:container-path "/usr/local/lib/mesos"
                                                                               :host-path "/usr/local/lib"
                                                                               :mode :ro}]})
    (catch Exception e
      (println e)
      (println (.getFullName (:field (ex-data e))))

                              (println "sending command" command)
                              (clj-mesos.scheduler/send-framework-message driver executor-id slave-id (.getBytes (pr-str command))))))
                        (when (= :task-running (:state status))
                          (swap! active-executors conj [(:executor-id status) (:slave-id status)]))
                        (let [id-from status (comp #(Integer/parseInt %) str last :task-id)] 
                          (cond 
                            (= (:task-state status) :task-staging) nil
                            (= (:task-state status) :task-starting) nil
                            (= (:task-state status) :task-running)
                            (swap! running conj (id-from-status status))
                            true 
                            (swap! pending conj (id-from-status status)))))))
      (resourceOffers [driver offers]
                      (future
                        (locking garbage-hack
