Closed Bug 1178205 Opened 9 years ago Closed 6 years ago

Make CancellableTimeout shared in a common toolkit module

Categories

(Toolkit :: Telemetry, defect, P4)

defect

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox42 --- affected

People

(Reporter: gfritzsche, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [measurement:client])

TelemetrySend introduces a CancellableTimeout, which allows async code to wait for a promise with a timeout, but still be woken up earlier if needed. This is potentially useful elsewhere, we should share this in a toolkit module.
Blocks: 1201022
No longer blocks: 1122482
As suggested by Yoric, this should probably go in PromiseUtils.jsm [0]. [0] - http://hg.mozilla.org/mozilla-central/annotate/5fe9ed3edd68/toolkit/modules/PromiseUtils.jsm
Priority: -- → P4
Whiteboard: [measurement:client]
This bug could be potentially mentored, but we need to figure out how to deal with testing first. We're using our Policy object to set/clear the timeout in [0]. [0] - https://dxr.mozilla.org/mozilla-central/rev/e790bba372f14241addda469a4bdb7ab00786ab3/toolkit/components/telemetry/TelemetrySend.jsm#279
Since nsITimer supports cancellation and the couple of other places cancellable timers and timeouts have been implemented, do we still want to pursue this?
Flags: needinfo?(alessio.placitelli)
(In reply to Chris H-C :chutten from comment #3) > Since nsITimer supports cancellation and the couple of other places > cancellable timers and timeouts have been implemented, do we still want to > pursue this? This is slightly different, as this CancellableTimeout (which is built on timers) resolves the promise when cancelled *and* when timing out. However, given comment 0, maybe Georg has stronger opinions on this. I personally think it should be ok to just close this as WONTFIX and re-open if needed :)
Flags: needinfo?(alessio.placitelli) → needinfo?(gfritzsche)
What Alessio said. This was well intended but is not something important to do.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(gfritzsche)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.