Implement ProgressPromise

ASSIGNED
Unassigned

Status

()

Core
DOM
ASSIGNED
4 years ago
3 years ago

People

(Reporter: jwatt, Unassigned)

Tracking

(Blocks: 1 bug, {dev-doc-needed})

Trunk
dev-doc-needed
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

I need this for bug 894840.

https://github.com/slightlyoff/Promises/blob/master/ProgressFuture.idl

Comment 1

4 years ago
Let's call that a Stream?

(In reply to Jonathan Watt [:jwatt] from comment #0)
> https://github.com/slightlyoff/Promises/blob/master/ProgressFuture.idl
No commit for the last 3 months and that's not part of the promise spec. I wouldn't count on the maturity of this tentative spec nor in the design.

Comment 2

4 years ago
I plan on adding it. I discussed it a bit with Mark around the TC39 meeting. We'll have to figure it out.

A ProgressPromise represents progress of a single value. An object stream represents a stream of values. The differences is that with the former you can ignore the progress reports, but with the latter the individual bits are important.
I think we should prototype this as

callback VoidAnyCallback = void (optional any value);
interface ProgressPromise : Promise {
  ProgressPromise progress(VoidAnyCallback callback);
}

The function always returns 'this'. I.e. it returns the same object it was called on. It'll call its callback with API-specific progress information (just like a Promise returns an API-specific result).

For now we should pref this such that it's only released on nightly and aurora though.
Keywords: dev-doc-needed
(Reporter)

Updated

4 years ago
Assignee: jwatt → nobody
Blocks: 935883

Updated

3 years ago
You need to log in before you can comment on or make changes to this bug.