Re: [screen-wake-lock] "Release a wake lock": should we queue a task to fire the "release" event? (#293)

> Can IDL dictionaries (e.g. PermissionDescriptor) be created when "in parallel"?

> Can IDL interfaces (e.g. WakeLockSentinel) "in parallel"?

Realm-agnostic things can be created in parallel. So, interfaces are realm-specific, and cannot be created there. For dictionaries, it depends on what the dictionary contains. Dictionary keys are strings, which are realm-agnostic, but their values vary. If one of the values is an interface, then that can't be created in parallel. If it's all primitives or sequences or records or similar, then it can.

> More generally speaking, if there are two subsequent parallel steps, one to queue a task to fire an event and another to resolve a promise, will the promise always be resolved after the event is fired?

> Not clear how resolving a promise in a parallel step (with an object created in parallel) works.

You can't resolve a promise from in parallel. You need to queue a task to do so. (And, you can use the same task to resolve the promise and fire the event.)

-- 
GitHub Notification of comment by domenic
Please view or discuss this issue at https://github.com/w3c/screen-wake-lock/issues/293#issuecomment-771798067 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 2 February 2021 17:08:42 UTC