[Dancer-users] Feedback requested: streaming support

sawyer x xsawyerx at gmail.com
Sat Aug 20 16:13:10 CEST 2011


Sorry for the late reply.

On Fri, Aug 19, 2011 at 5:16 PM, damien krotkine <dkrotkine at gmail.com>wrote:

>
> > 2. The reason this is in send_file() is because a. someone asked it for
> > send_file specifically, and b. this is where it will be mostly used.
> People
> > need to stream files. Refactoring this into another keyword (say,
> > "streamed_response", or "streamed_content") will allow people to use this
> > outside of send_file(), but it still remains very relevant inside
> > send_file().
> > Yes, you can open the files yourself and take care of all of it, but if
> > you'll need another layer of callback, and that's not very comfortable if
> > all you want to do is to send a file streaming.
>
>
> What about : stream_file() in addition to send_file() then ? Just to
> avoid adding more complexity to send_file() ? with redirection in the
> doc between the two ?
>

I don't think it's adding complexity. The user doesn't have to use the
streaming options. But if she wants to, they are available. I'm very
reluctant to add new keywords and I'm already going to add one:
streamed_content.


> > 5. I won't change any name to include "psgi" unless necessary, because a
> > user shouldn't know what PSGI is.
>
>
> Hmm well then, don't provide a callback where (quoting your words:)
> "you should understand how PSGI streaming works". If you do, be
> explicit that this is psgi related. I don't know, it seemed more
> "fair" to advertise it rather than hide it. Or, don't provide this
> method at all, or a wrapper that wouldn't require you to learn PSGI ?
>

It's like this: if you don't know PSGI, it's okay because everything will be
fine. However, if you do know PSGI, you will be able to do something more
complex without leaving Dancer.

Preventing an optional PSGI-specific ability just because not everyone would
know it is like not allowing users in Perl access to manipulate the symbol
table just because not everyone knows how it works. You don't have to use
it, but it's there for those who need it. No need to specifically call it
PSGI, I'll just document it properly for those who want to use it.

Thanks again for all the patience and input!
Sawyer. :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110820/b3111520/attachment.htm>


More information about the Dancer-users mailing list