-
-
Save anonymous/d4dad5ff47ae7e92f7a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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