Am Montag, 21. September 2015 18:27:49 UTC+2 schrieb sri:
>
> This might be helpful.
>
>    
> http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Streaming-response
>

I´m afraid it isn´t. 
Unless I´m just acting blockheaded and miss something glaringly obvious, 
that is the part of the problem I considered solved.
Hopefully I simply failed at describing the problematic part, so let´s try 
this again.

I created a gist with some code which hopefully helps to explain the 
situation.
https://gist.github.com/heikojansen/b3598e5747a38a084ac9

There´s a backend server and two apps which show my approaches for creating 
the middleware app.
First start the backend server, then start one of the "proxies" and run
curl 'http://127.0.0.1:3000/backend' -H 'Accept: text/event-stream'
in your shell or point your browser to http://127.0.0.1:3000/page

Upon request "proxy1.pl" opens a connection to the backend server, 
retrieves the data in a series of "read" events and sends the data to the 
client (browser). 
Unfortunately, the transformed results shows in the browser only after the 
final part of the backend server response has been received and processed 
and not almost immediately after the data processing in the proxy, as 
desired.

"proxy2.pl" only writes 
start() callback; tx finished? 1
to STDERR and immediately finishes processing without even sending a 
request to the backend.

Currently I have no idea, what I should change or which other approach I 
should take to get the desired immediate forwarding of the transformed 
result.

Thanks again for any hint
Heiko

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to