fishjam-dev / membrane_rtc_engine

Customizable Real-time Communication Engine/SFU library focused on WebRTC.
Apache License 2.0
141 stars 13 forks source link

Add async subscribe function #407

Closed roznawsk closed 2 months ago

roznawsk commented 2 months ago

Using the current subscribe/4 function can sometimes cause deadlock. This happens when the Engine is currently in the process of linking the Endpoint to other elements, and at the same time the Endpoint subscribes for some track.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 54.87%. Comparing base (eb8f97d) to head (4f4bf95). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #407 +/- ## ========================================== + Coverage 54.51% 54.87% +0.36% ========================================== Files 75 75 Lines 3348 3357 +9 ========================================== + Hits 1825 1842 +17 + Misses 1523 1515 -8 ``` | [Files with missing lines](https://app.codecov.io/gh/fishjam-dev/membrane_rtc_engine/pull/407?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev) | Coverage Δ | | |---|---|---| | [engine/lib/membrane\_rtc\_engine/engine.ex](https://app.codecov.io/gh/fishjam-dev/membrane_rtc_engine/pull/407?src=pr&el=tree&filepath=engine%2Flib%2Fmembrane_rtc_engine%2Fengine.ex&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev#diff-ZW5naW5lL2xpYi9tZW1icmFuZV9ydGNfZW5naW5lL2VuZ2luZS5leA==) | `82.97% <100.00%> (+2.53%)` | :arrow_up: | | [engine/test/support/fake\_endpoint.ex](https://app.codecov.io/gh/fishjam-dev/membrane_rtc_engine/pull/407?src=pr&el=tree&filepath=engine%2Ftest%2Fsupport%2Ffake_endpoint.ex&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev#diff-ZW5naW5lL3Rlc3Qvc3VwcG9ydC9mYWtlX2VuZHBvaW50LmV4) | `76.92% <100.00%> (+6.92%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/fishjam-dev/membrane_rtc_engine/pull/407/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/fishjam-dev/membrane_rtc_engine/pull/407?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/fishjam-dev/membrane_rtc_engine/pull/407?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev). Last update [eb8f97d...4f4bf95](https://app.codecov.io/gh/fishjam-dev/membrane_rtc_engine/pull/407?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fishjam-dev).