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

Force v8 promise resolving to publish/subscriber faster #1633

Merged
merged 3 commits into from
Sep 21, 2020

Conversation

jcague
Copy link
Contributor

@jcague jcague commented Sep 15, 2020

Description

There was a long delay of some seconds between a promise was resolved and the corresponding listeners were triggered in ErizoAPI. This fix aims to force those triggers to complete Promise resolving quicker.

[] It needs and includes Unit Tests

Changes in Client or Server public APIs

Not needed.

[] It includes documentation for these changes in /doc.

Copy link
Contributor

@lodoyun lodoyun left a comment

Choose a reason for hiding this comment

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

This looks good to me.

obj->futures.pop();
obj->Unref();
v8::Isolate::GetCurrent()->RunMicrotasks();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Is this safe to use in all the places we resolve promises? I'm thinking about MediaStream particularly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right, I'm looking for all places where we use v8::Promise

@@ -106,7 +106,7 @@ const PeerConnectionFsm = StateMachine.factory({
},

onPendingTransition: function onPendingTransition(transition, from, to) {
const lastTransition = this.history.lenth > 0 ? this.history[this.history.length - 1].transition : 'none';
const lastTransition = this.history.length > 0 ? this.history[this.history.length - 1].transition : 'none';
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@jcague jcague merged commit c2c3b98 into lynckia:master Sep 21, 2020
@jcague jcague deleted the fix/various_fixes branch September 21, 2020 12:39
Arri98 pushed a commit to Arri98/licode that referenced this pull request Apr 6, 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.

2 participants