-
Notifications
You must be signed in to change notification settings - Fork 10
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
Specify event handling with algorithms #56
Comments
The eureka moment for me is the realization that there is no queue of events, but rather, events can be fired either directly or from a queued task, but do not otherwise form a queue. Thank you @jan-ivar for bring it up, and thank you @alvestrand for clarifying. With that in mind:
|
For a user agent to trigger anything JS-observable, we must start from "When something happens, the user agent MUST queue a task" as I show above, to preserve run-to-completion semantics. The "Update JS-observable state" step would be to set a See "When the underlying DTLS transport needs to update the state" for an example. |
I'm leaving this comment there as well to not keep track of it.
Originally posted by @beaufortfrancois in #57 (comment) |
"The user agent fires an event" is under-specified, in ways that raises questions around timing.
Event handling is tricky and requires algorithms, since JS isn't allowed to observe things progressing in background processes naturally. For external occurrences, I recommend what WebRTC uses (as a minimum):
foo
at target.This makes it easy to abide by the following design rule: "Where possible, use a plain Event with a specified type, and capture any state information in the target object." — because state is updated on the same task the event fires on (event dispatch is synchronous).
The text was updated successfully, but these errors were encountered: