Open Bug 1507653 Opened 7 years ago Updated 2 years ago

Extend PromiseWorker to support asynchronously executing workers

Categories

(Toolkit :: General, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: alexical, Assigned: alexical)

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
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: