Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "geolocation task queue" #87

Merged
merged 10 commits into from
Jul 8, 2021
Merged

Add "geolocation task queue" #87

merged 10 commits into from
Jul 8, 2021

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Jun 9, 2021

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

Copy link
Member

@reillyeon reillyeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some nits.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@annevk
Copy link
Member

annevk commented Jun 10, 2021

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
Copy link
Member Author

marcoscaceres commented Jun 10, 2021

@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
Copy link
Member Author

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

@marcoscaceres marcoscaceres changed the title Editorial: always invoke in a micro task step Add "geolocation task queue" Jun 10, 2021
@marcoscaceres
Copy link
Member Author

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

@annevk
Copy link
Member

annevk commented Jun 14, 2021

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).

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@marcoscaceres marcoscaceres merged commit 41d7945 into gh-pages Jul 8, 2021
@marcoscaceres marcoscaceres deleted the invoke_in_task branch July 8, 2021 04:21
@marcoscaceres marcoscaceres mentioned this pull request Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Callbacks are invoked while in parallel
3 participants