Open Bug 1507653 Opened 2 years ago Updated 4 months ago

Extend PromiseWorker to support asynchronously executing workers

Categories

(Toolkit :: General, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: dthayer, Assigned: dthayer)

References

Details

Attachments

(1 file)

If we want to do asynchronous work inside of a worker right now, we can't use a PromiseWorker. The worker/PromiseWorker.js code expects the dispatch(...) function to immediately return a value, and BasePromiseWorker implements the request ids as simply a debug check on its queue-based message processing.

We should use a Map of id's to handlers instead of a queue, and allow returning a promise inside the worker code itself.
P1'ing given this has an assignee. :-)
Priority: -- → P1
Right now PromiseWorker supports an async interface on the
consumer side, but the worker code itself can't be async. This
can be a barrier for bringing certain things (see Bug 1502146
easily into a worker).
Priority: P1 → P3
You need to log in before you can comment on or make changes to this bug.