Skip to content

Instantly share code, notes, and snippets.

/neg-atom.clj Secret
Created May 15, 2014

Embed
What would you like to do?
(ns foobar.baz
(:require [amazonica.core :as aws]
[amazonica.aws.s3]
[amazonica.aws.s3transfer :as s3]))
(def pending (atom 0))
(let [ul (s3/upload :bucket-name bucket-name
:key s3-upload-path
:input-stream input-stream
:metadata {:content-length size
:content-type content-type}
:access-control-list {:grant-permission ["AllUsers" "Read"]})
listener #(condp = (:event %)
:started (swap! pending inc)
:failed (swap! pending dec)
:completed (swap! pending dec)
nil %)]
((:add-progress-listener ul) listener))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.