Re: StreamBuilder threshold

On 02/23/2012 12:58 AM, Feras Moussa wrote:
>> -----Original Message-----
>> From: Stefan Hakansson LK [mailto:stefan.lk.hakansson@ericsson.com]
>> Sent: Sunday, February 05, 2012 4:50 AM
>> To: Feras Moussa
>> Cc: Travis Leithead; public-webapps@w3.org
>> 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
> event.

Would be great to clarify. But to my understanding you could always call 
"createObjectURL" again with the same Stream as input argument. Even if 
both "createObjectURL"'s generate one-time URLs, you could have a 'race' 
condition.

>
>> 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.

Actually I am not trying to satisfy a specific scenario, but I've heard 
people thinking about sending a Stream (being generated at this device 
using StreamBuilder) to several remote ends. I think this would not 
really work since there would always be some differences in transmission 
speed and then the low buffer threshold would have several different 
triggers (as discussed above).

I think it need to be clarified that you can't do this (or attach it to 
several tags), but it is not clear how to clarify it to me (as said 
above, even if you have one time URLs you can create several of them).

Thanks,
Stefan

>
> Thanks,
> Feras
>
>
>>>
>>> Also, For future reference, the latest draft is now located on the W3
>>> site at http://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm
>>
>> Thanks for updating me!
>>
>> Stefan
>>
>>>
>>> Thanks, Feras
>>>
>>>> -----Original Message----- From: Stefan Hakansson LK
>>>> [mailto:stefan.lk.hakansson@ericsson.com] Sent: Tuesday, January 17,
>>>> 2012 12:28 AM To: Feras Moussa; Travis Leithead Cc:
>>>> public-webapps@w3.org Subject: StreamBuilder threshold
>>>>
>>>> I'm looking at
>>>> http://html5labs.interoperabilitybridges.com/streamsapi/, 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 Thursday, 23 February 2012 10:56:39 UTC