     (into {} es)))
 
 (defn chan->seq
-  "Drains a channel onto a lazy sequence.  Blocks internally."
+  "Drains a channel onto a lazy sequence.  If the optional terminate?
+argument is true, it will return immediately with whatever is currently
+available on the channel; otherwise it will block until data is available."
   [c & [terminate?]]
   (lazy-seq
    (when-let [v (if terminate?

    t))


(defn cancel-requests [rs]
  (let [ds (:spot-instance-requests (describe-spot-instance-requests :spot-instance-request-ids rs))
        is (filter (complement nil?) (map :instance-id ds))
        cr (:cancelled-spot-instance-requests (cancel-spot-instance-requests :spot-instance-request-ids rs))


(def ids->chs (atom {}))

(defn- notify-chan
  "Return a channel that will receive status information extracted from send-up messages
with the specified id.  See b64->ec2-data."
  [id]
  (let [c (chan)]
    (swap! ids->chs assoc id c)
    c))
