How to handle chunked/streamed response data using Zend_Http_Client?

875 views Asked by At

I have a Zend_Http_Client which connects to a HTTP-Server that streams its data in chunks.

I want to handle each received chunk directly as it is received.

None of the existing Http_Adapter in the Zend Framework seem to not provide a chunk-based-handling.

So far I have tried two different (working) solutions:

  1. Creating my own Http_Client_Adapter with my own read function that includes the handling
  2. Registering my own stream schema (myHandler://) and let the Http_Client write its streaming data directly my handler

… but I would like to stick as close as possible to existing functions.

Therefore is my question:
Is there a Zend-Framework "native" solution with which I can go in a loop to receive chunk-by-chunk or define a user_function to be called with each chunk?

0

There are 0 answers