Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

look into how best way to support streaming responses #217

Open
lsmith77 opened this Issue Mar 29, 2012 · 5 comments

Comments

Projects
None yet
4 participants
Owner

lsmith77 commented Mar 29, 2012

this will need to be handled likely in View, ViewHandler and ViewResponseListener

for the later this is what SensioFrameworkExtraBundle

        if (!$request->attributes->get('_template_streamable')) {
            $event->setResponse($templating->renderResponse($template, $parameters));
        } else {
            $callback = function () use ($templating, $template, $parameters) {
                return $templating->stream($template, $parameters);
            };


            $event->setResponse(new StreamedResponse($callback));
        }

mcg-web commented Jul 28, 2014

This feature look nice to me ! Is there any particulars reasons why this feature could not be implement ?

Owner

lsmith77 commented Jul 29, 2014

no .. I do not think anyone ever tried to implement it

mcg-web commented Jul 29, 2014

Ok thank you for your answer. I'll try to implement it.

Contributor

Wirone commented May 13, 2015

+1 this is crucial ❗️

We have API method for generating report. It can be returned as json or xml with simple array passed from controller. However, we would like to serve csv and xlsx formats, then controller would return StreamedResponse. Now we have to register custom handler (in development now, I hope it will work..). Would be so easier with this feature.

Wasn't it implemented since 2012 or I'm missing something?

@lsmith77 lsmith77 added this to the 2.0 milestone Jul 10, 2015

@lsmith77 lsmith77 modified the milestone: 2.0 Nov 10, 2015

jdwil commented Apr 20, 2016

I'd like to see this as well, though I think it's most useful in conjunction with a serializer that supports streams as well, and JMS/Serializer does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment