w3c / geolocation

W3C Geolocation API
https://www.w3.org/TR/geolocation/
81 stars 56 forks source link

Add "geolocation task queue" #87

Closed marcoscaceres closed 3 years ago

marcoscaceres commented 3 years ago

Closes #80

@annevk, I did as you suggested:

  1. Collapsed the "Acquire a watch id" labelled steps.
  2. "Run these steps [=in parallel=]:".
  3. Tied all callback invocations to a microtask.
  4. And now I return |watchId| as the final step.

As I had to re-indent the algorithm, probably best viewed in PR-Preview.


Preview | Diff

annevk commented 3 years ago

Pretty sure that a microtask can only be queued in the context of a task. When you're in parallel you have to queue a task.

marcoscaceres commented 3 years ago

@annevk, ok, I was a bit unsure. I'll queue a task, but was unsure what task source to go with... should I mint a new one for geolocation? Or do you have a suggestion for an existing one?

marcoscaceres commented 3 years ago

Gave this some thought... as every browser has its own dedicated location service manager, I'm going to mint a "geolocation task source".

marcoscaceres commented 3 years ago

@annevk, added the new "geolocation task source" 🥫.

annevk commented 3 years ago

Seems reasonable. You want to use "queue a global task" and probably pass "this's relevant global object" (that you put in a variable before going in parallel).