Skip to content
Permalink
Browse files

[giow] (2) Make EventSource.close() cause the events to stop firing e…

…ven if they're already queued.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=14331

git-svn-id: http://svn.whatwg.org/webapps@6688 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 14, 2011
1 parent 210d4ef commit 0a3e8a7accb60003b82ce4be16146d1763b13b32
Showing with 29 additions and 9 deletions.
  1. +9 −3 complete.html
  2. +9 −3 index
  3. +11 −3 source
method must abort any instances of the <a href=#fetch>fetch</a> algorithm
started for this <code><a href=#eventsource>EventSource</a></code> object, and must set the
<code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute
to <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p>
to <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p> <!-- this
also causes all the message events to stop firing, even if they were
queued before close() was called -->

<p>The following are the <a href=#event-handlers>event handlers</a> (and their
corresponding <a href=#event-handler-event-type title="event handler event type">event handler

<li><p>Set the <var title="">data</var> buffer and the <var title="">event name</var> buffer to the empty string.</li>

<li><p><a href=#queue-a-task>Queue a task</a> to dispatch the newly created
event at the <code><a href=#eventsource>EventSource</a></code> object.</li>
<li><p><a href=#queue-a-task>Queue a task</a> which, if the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute is
set to a value other than <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>, dispatches the newly
created event at the <code><a href=#eventsource>EventSource</a></code> object.</li> <!--
so calling close() drops the messages immediately. The connection
dying doesn't interfere with already-sent messages since it sets us
to CLOSED via a task, not synchronously -->

</ol><p class=note>If an event doesn't have an "id" field, but an
earlier event did set the event source's <a href=#concept-event-stream-last-event-id title=concept-event-stream-last-event-id>last event ID
12 index
method must abort any instances of the <a href=#fetch>fetch</a> algorithm
started for this <code><a href=#eventsource>EventSource</a></code> object, and must set the
<code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute
to <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p>
to <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>.</p> <!-- this
also causes all the message events to stop firing, even if they were
queued before close() was called -->

<p>The following are the <a href=#event-handlers>event handlers</a> (and their
corresponding <a href=#event-handler-event-type title="event handler event type">event handler

<li><p>Set the <var title="">data</var> buffer and the <var title="">event name</var> buffer to the empty string.</li>

<li><p><a href=#queue-a-task>Queue a task</a> to dispatch the newly created
event at the <code><a href=#eventsource>EventSource</a></code> object.</li>
<li><p><a href=#queue-a-task>Queue a task</a> which, if the <code title=dom-EventSource-readyState><a href=#dom-eventsource-readystate>readyState</a></code> attribute is
set to a value other than <code title=dom-EventSource-CLOSED><a href=#dom-eventsource-closed>CLOSED</a></code>, dispatches the newly
created event at the <code><a href=#eventsource>EventSource</a></code> object.</li> <!--
so calling close() drops the messages immediately. The connection
dying doesn't interfere with already-sent messages since it sets us
to CLOSED via a task, not synchronously -->

</ol><p class=note>If an event doesn't have an "id" field, but an
earlier event did set the event source's <a href=#concept-event-stream-last-event-id title=concept-event-stream-last-event-id>last event ID
14 source
method must abort any instances of the <span>fetch</span> algorithm
started for this <code>EventSource</code> object, and must set the
<code title="dom-EventSource-readyState">readyState</code> attribute
to <code title="dom-EventSource-CLOSED">CLOSED</code>.</p>
to <code title="dom-EventSource-CLOSED">CLOSED</code>.</p> <!-- this
also causes all the message events to stop firing, even if they were
queued before close() was called -->

<p>The following are the <span>event handlers</span> (and their
corresponding <span title="event handler event type">event handler
<li><p>Set the <var title="">data</var> buffer and the <var
title="">event name</var> buffer to the empty string.</p></li>

<li><p><span>Queue a task</span> to dispatch the newly created
event at the <code>EventSource</code> object.</p></li>
<li><p><span>Queue a task</span> which, if the <code
title="dom-EventSource-readyState">readyState</code> attribute is
set to a value other than <code
title="dom-EventSource-CLOSED">CLOSED</code>, dispatches the newly
created event at the <code>EventSource</code> object.</p></li> <!--
so calling close() drops the messages immediately. The connection
dying doesn't interfere with already-sent messages since it sets us
to CLOSED via a task, not synchronously -->

</ol>

0 comments on commit 0a3e8a7

Please sign in to comment.
You can’t perform that action at this time.