[squeak-dev] [ANN] WebClient and WebServer 1.0 for Squeak

Igor Stasenko siguctua at gmail.com
Tue May 11 14:56:04 UTC 2010


On 11 May 2010 17:52, Igor Stasenko <siguctua at gmail.com> wrote:
> Hi, Andreas,
>
> just one feature request: support streaming in WebClient,
> i.e. apart from being able to fetch a response content in a single blob,
> also provide an API, which would enable WebClient user to read content
> step by step,
> by using stream protocol, i.e. #next, #next: etc.
>
> I see you having a #streamFrom:to:size:progress:
> in WebMessage, but its a little bit too high level (requires an output
> stream and includes a progress block)
> and its end consumer is a #content message.
>
> It would be nice to have something like:
>
> response := WebClient httpGet: 'http://foo.bar'.
>
> content := response content. "read all at once".
>
a little remark (to avoid confusion): the above line shows how to
fetch the content in a single blob,
while following lines showing how to fetch content using stream. These
two ways, obviously, should not be used simultaneously.

> contentStream := response contentStream.  "read content using a stream"
> [contentStream atEnd] whileFalse: [
>  c := contentStream next.  ....
> ].
>
> There are some special uses of HTTP protocol which establishing a
> permanent socket connection
> and then sending a content in a small portions piece by piece over a time.
> Obviously, with such kind of connection, if you try to get all content
> at once (by using #content) you'll never get it to the end, because
> there's always more to read, if you wait long enough.
> But if you allow a streaming, then user could read content by portions
> and handle portions step by step and don't have to wait till all
> content arrives.
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list