Closed Bug 1920245 Opened 1 year ago Closed 1 year ago

Add extension task queue helper

Categories

(WebExtensions :: General, task, P2)

task

Tracking

(firefox134 fixed)

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

An ordered task queue is occasionally needed in extension code. Because there was no generic utility, there are multiple implementations of queues, and even implicit ordering.

Examples:

There are more use cases:

  • userScripts API also needs to register/update/unregister scripts. Unlike the scripting API, I don't want to force the implementation to be synchronous, because that is very restrictive and would force suboptimal implementation design choices, such as having to keep too much data in memory.

This patch provides a task queue helper that supports the following:

  • Parallel reads + sequential writes. Running tasks as fast as possible.

  • Queue lifetime tied to extension lifetime, but without requiring an
    Extension to be around, because that is not always available
    (e.g. for operations past add-on uninstall).

Severity: -- → N/A
Priority: -- → P2
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/ecef33a461c9 Add read/write task queue helper r=zombie
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: