Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
checking if content was downloaded completly
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Thomas Klausner  
View profile  
 More options Oct 29 2012, 11:44 am
From: Thomas Klausner <d...@plix.at>
Date: Mon, 29 Oct 2012 08:44:31 -0700 (PDT)
Local: Mon, Oct 29 2012 11:44 am
Subject: checking if content was downloaded completly

No response yet on IRC, so I try here:

10:06 < domm> hey, I've got a questions regarding a streaming plack app
(i.e.
              not a middleware)
10:06 < domm> after sending a file, I need to send a request to another
server
              (but only if the whole file was transmitted)
10:06 < domm> I've come up with something like this:
10:06 < domm> http://domm.plix.at/share/plack.stream.txt
10:07 < domm> which works if run via plackup, but not if run via eg Starman
10:07 < domm> I assume because I need to do some response_cb magic?
10:08 < domm> but as I'm not doing a middleware, I cannot get a $res via
              $app->($env)
10:08 < domm> any ideas/pointers?

Also, after looking at the Starman source code (sub _finalize_response), it
seems to me that a plack App and a webserver like Starman behave like a
webapp behind a proxy, i.e. the whole content is sent to the proxy
(starman) which then transfers it to the user. Which means it's not
possible to check if the whole content arrived at the user.

So is there any way to fire an http request after a download is completed?

(more context, if you care: one customer (public radio station) provides a
download service where users can download a limited amount of programs as
mp3. we can only deduct the download from each users count if we're rather
sure the user got the whole file. currently this is implemented in some
oldschool catalyst (pre-plack) and some similar fuzzing with ->write as in
the sample I showed. I now want to update the app, and split the download
thingy into a small standalone server (Plack & Starman (or whatever)). )

Greetings,
domm


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tatsuhiko Miyagawa  
View profile  
 More options Oct 29 2012, 1:14 pm
From: Tatsuhiko Miyagawa <miyag...@gmail.com>
Date: Mon, 29 Oct 2012 10:14:07 -0700
Local: Mon, Oct 29 2012 1:14 pm
Subject: Re: checking if content was downloaded completly
Your sample code seems to be checking the return value of ->write to
check if it's actually written, and that is not a behavior defined in
the PSGI specification but happens to be implemented in
HTTP::Server::PSGI and Starlet.

avar proposed to add something similar to the PSGI specification:
https://github.com/plack/psgi-specs/wiki/Proposal:-Return-values-for-...

I think it makes sense in the blocking server implementation but maybe
not so much in async/non-blocking servers since mostly ->write method
there is to queue up the data write.

--
Tatsuhiko Miyagawa

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »