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

fix: Remove blocking for BEAM thread #98

Merged
merged 7 commits into from
Dec 7, 2021
Merged

fix: Remove blocking for BEAM thread #98

merged 7 commits into from
Dec 7, 2021

Conversation

satoren
Copy link
Member

@satoren satoren commented Dec 3, 2021

@satoren satoren force-pushed the mshiraki/scheduler branch 4 times, most recently from 3dfbc5d to e68d817 Compare December 3, 2021 13:09
@barecheck
Copy link

barecheck bot commented Dec 3, 2021

Barecheck - Code coverage report

Total: 100.00%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

native/mediasoup_elixir/src/consumer.rs Outdated Show resolved Hide resolved
native/mediasoup_elixir/src/consumer.rs Outdated Show resolved Hide resolved
@satoren satoren changed the title fix: create_worker to async fix: Remove blocking for BEAM thread Dec 6, 2021
@@ -66,6 +67,40 @@ where
});
}

// workarounf for future created by async block is not `Send` at send_async_nif_result
pub fn async_nif_thread_spawn<T, E, Fn, Fut>(env: Env, future: Fn) -> NifResult<(Atom, Atom)>
Copy link

Choose a reason for hiding this comment

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

ah i see. you're defining your own future to handle Send + Sync.

Copy link
Member Author

Choose a reason for hiding this comment

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

versatica/mediasoup#729
This fix has been merged and I can remove this workaround later.

Copy link

@darwin67 darwin67 left a comment

Choose a reason for hiding this comment

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

Nice! Async is definitely the future so great job!

Copy link
Contributor

@h3poteto h3poteto left a comment

Choose a reason for hiding this comment

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

😆

@satoren satoren merged commit de49804 into main Dec 7, 2021
@satoren satoren deleted the mshiraki/scheduler branch December 7, 2021 23:45
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.

3 participants