Fork me on GitHub
#yada
<
2016-10-19
>
peterwestmacott08:10:58

@malcolmsparks thanks for the new bidi, that’s fixed my vhosts-model issue.

malcolmsparks08:10:41

@peterwestmacott it's odd but when @stijn asked yesterday I could have sworn the vhosts wildcard thing was in the released bidi, that's why your issue confused me. At least now it's mystery solved.

stijn12:10:41

is there an example of streaming file upload? i.e. async consumption of the body

stijn12:10:49

the use case is upload to google cloud storage

malcolmsparks12:10:56

@stijn yes certainly. Have a look under dev/ in the repo. Grep for Consumer

stijn12:10:26

@malcolmsparks ah, interesting, yada.consume/save-to-file is using java NIO to write the chunks to a file?

malcolmsparks12:10:52

Yes. It's fully async.

stijn12:10:22

congratulations on the conciseness of that code! 🙂

malcolmsparks12:10:37

The throughput is pretty good. ~200Mb/s

stijn12:10:52

should be good enough for our usecase 🙂

stijn12:10:11

that's on an SSD drive I assume

stijn12:10:05

is there a way of communicating to the client how much data has been saved? or does the client need to keep track of that?

malcolmsparks15:10:10

I don't know what upload sites give feedback. Most image uploaders seem to give spinners

malcolmsparks15:10:48

I think if you use built in FormData you don't get feedback. Not sure.

malcolmsparks15:10:59

Does FormData have an api?

malcolmsparks15:10:26

But you could set up some signalling between your yada part consumer and your client

malcolmsparks15:10:40

What does youtube do?

lmergen15:10:15

well, i know we allow our users to upload “huge” files, and we chunk those files in the frontend

malcolmsparks15:10:24

@stijn off topic but who's at euroclojure next week?

lmergen15:10:26

this is a pretty common approach

lmergen15:10:49

better yet, this approach also allows for resuming of uploads

lmergen15:10:07

i know that youtube and dropbox take this approach as well

malcolmsparks15:10:52

yada definitely needs to support partials and soon!

lmergen15:10:35

yes, although you can perfectly “hack” your way around it by just provided a ?offset=X param

stijn17:10:08

yes, google cloud storage has this type of resumable uploads too

stijn17:10:33

maybe I'm just going to forward these requests to it or see if the client can upload directly to cloud storage

stijn17:10:57

@malcolmsparks i'll be there from Monday evening to Thursday