<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23790</bug_id>
          
          <creation_ts>2013-11-11 08:06:54 +0000</creation_ts>
          <short_desc>Remove size argument from read() and introduce pullAmount attribute instead</short_desc>
          <delta_ts>2013-12-05 19:56:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>Streams API</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Takeshi Yoshino">tyoshino</reporter>
          <assigned_to name="Takeshi Yoshino">tyoshino</assigned_to>
          <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>96111</commentid>
    <comment_count>0</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2013-11-11 08:06:54 +0000</bug_when>
    <thetext>Now readExact() and read() are separate. It looks we should do further refactoring to remove size (actually meant maxSize) argument from read() and introduce pullAmount attribute instead.

NOTE: This name (pullAmount) is chosen rather than &quot;bufferSize&quot; since it can have misleading message that we can control implementation detail of the producer.

We supposed that most people don&apos;t want to manually control pull amount but just want to use default value. So, the pulling amount parameter should be provided as an attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96139</commentid>
    <comment_count>1</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2013-11-11 19:20:06 +0000</bug_when>
    <thetext>Since we cannot install a hook which is invoked right after fulfill callback is run, a user cannot decrease pullAmount on completion of one read().

pullAmount = 1024
...
readPromise is fulfilled with 512 bytes
Fulfill callback is run asynchronously
Inside fulfill callback we run this
  pullAmount = 512
But at this point, underlying IO may be already instructed to fetch 1024 bytes of data.

We should enable gradual decrease of pullAmount?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96140</commentid>
    <comment_count>2</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2013-11-11 19:41:30 +0000</bug_when>
    <thetext>(In reply to Takeshi Yoshino from comment #1)
&gt; Since we cannot install a hook which is invoked right after fulfill callback
&gt; is run, a user cannot decrease pullAmount on completion of one read().
&gt; 
&gt; pullAmount = 1024
&gt; ...
&gt; readPromise is fulfilled with 512 bytes
&gt; Fulfill callback is run asynchronously
&gt; Inside fulfill callback we run this
&gt;   pullAmount = 512
&gt; But at this point, underlying IO may be already instructed to fetch 1024
&gt; bytes of data.
&gt; 
&gt; We should enable gradual decrease of pullAmount?

Until next read() call, the number of bytes used for fulfilling the last read() call should occupy the pullAmount.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96236</commentid>
    <comment_count>3</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2013-11-13 17:13:51 +0000</bug_when>
    <thetext>(In reply to Takeshi Yoshino from comment #2)
&gt; Until next read() call, the number of bytes used for fulfilling the last
&gt; read() call should occupy the pullAmount.

Done in preview ver. bytesBeingOutpu does it.
https://dvcs.w3.org/hg/streams-api/raw-file/tip/preview.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96277</commentid>
    <comment_count>4</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2013-11-14 01:51:34 +0000</bug_when>
    <thetext>Should pullAmount reset bytesBeingOutput?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97215</commentid>
    <comment_count>5</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2013-12-05 19:56:34 +0000</bug_when>
    <thetext>Preview ver merged into ED. Closing this bug.

(In reply to Takeshi Yoshino from comment #4)
&gt; Should pullAmount reset bytesBeingOutput?

This is put into a separate bug entry.
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24008</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>