RE: StreamBuilder threshold

> -----Original Message-----
> From: Stefan Hakansson LK []
> Sent: Sunday, February 05, 2012 4:50 AM
> To: Feras Moussa
> Cc: Travis Leithead;
> Subject: Re: StreamBuilder threshold
> On 01/26/2012 07:05 PM, Feras Moussa wrote:
> > Can you please clarify what scenario you are looking at regarding
> > multiple consumers? When designing the StreamBuilder API, we looked at
> > it as a more primitive API which other abstractions (such as multiple
> > consumers) can be built upon.
> (Please forgive me if I am making stupid input - I am in a learning phase). A
> very simple scenario would be the example in the draft that "demonstrates
> how to use StreamBuilder to load a stream into the audio tag". In this
> example the consumer is an audio tag, and new data is appended to the
> stream each time the buffer falls below 1024 bytes. Fine so far, but what
> happens if the same stream (via createObjectURL) is connected to one more
> audio tag, but at T ms later.
> In this case the first audio tag would have consumed down to the threshold
> (1024 bytes) T ms before the second.

This isn't clear from the spec (And I've made a note to clarify it) but URLs for
 streams should be one time use URLs (once used it should be automatically 
revoked). Thus a scenario as you said below (connecting the same stream to 
multiple tags) isn't possible. There will only be one event to notify the threshold 
has been reached, thus there should not be multiple consumers 'racing' for this 
> Another example could be that one Stream is uploaded using two parallel
> xhr's; one of them could have a couple of pakcet losses and then consume
> slower than the other (and if WS could take send(stream) the same would
> apply).
> >
> > If you can please let me know what issue you're trying to address, I'm
> > happy to discuss the possibilities.
> I hope the above input explained the issue.

However, I'm still not clear on what the scenario you'd like to accomplish is - can 
you please explain it in more detail? If you're looking for a way to reuse data 
from a Stream, then you should use StreamReader to read the data as a Blob 
(or another type) which will then provide you with all the Blob semantics, 
including multiple reads on the data.


> >
> > Also, For future reference, the latest draft is now located on the W3
> > site at
> Thanks for updating me!
> Stefan
> >
> > Thanks, Feras
> >
> >> -----Original Message----- From: Stefan Hakansson LK
> >> [] Sent: Tuesday, January 17,
> >> 2012 12:28 AM To: Feras Moussa; Travis Leithead Cc:
> >> Subject: StreamBuilder threshold
> >>
> >> I'm looking at
> >>, and
> >> specifically at the StreamBuilder.
> >>
> >> It has the possibility to generate an event if the data available
> >> falls below a threshold. How is this supposed to work if there is
> >> more than one consumer, and those consumers either don't start
> >> consuming at exactly the same time or consume at different rates, of
> >> the Stream?
> >>
> >> --Stefan
> >
> >

Received on Wednesday, 22 February 2012 23:59:12 UTC