Closed Bug 985953 Opened 10 years ago Closed 6 years ago

Using async-utils with protocol.js is aesthetically unattractive

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jwalker, Unassigned)

Details

functionName: method(async(function*(params) {
    // ...
  }, ....)),

Looking at Task.jsm, I'd think that the overhead is irrelevant compared to using the network, so I think we could probably make this the default.
By "make this the default", I mean: Make it so that method() does async() automatically.
One somewhat related note: use Task.async now instead of async from async-utils. It does the same thing, but was deemed useful enough to live in Task itself.
That will make it even more horrible looking :/

functionName: method(Task.async(function*(params) {
Task.async() is such a small function that we *may* benefit by re-implementing it and doing something better than the default with exceptions/rejects.
(In reply to Joe Walker [:jwalker] from comment #4)
> Task.async() is such a small function that we *may* benefit by
> re-implementing it and doing something better than the default with
> exceptions/rejects.

Certainly. I think there's benefits to using asyncUtils.asyncOnce since that's a common pattern in our tools, for example.
Assigning to me so I don't forget, but feel free to take it off me.
Assignee: nobody → jwalker
Assignee: jwalker → nobody
I believe native promises and async / await have removed this concern.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.