-
Notifications
You must be signed in to change notification settings - Fork 49
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
Move to another thread #261
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the motivation of the change?
updated the description. |
@@ -30,7 +30,8 @@ class DefaultAudioClientController( | |||
private val audioClientObserver: AudioClientObserver, | |||
private val audioClient: AudioClient, | |||
private val meetingStatsCollector: MeetingStatsCollector, | |||
private val eventAnalyticsController: EventAnalyticsController | |||
private val eventAnalyticsController: EventAnalyticsController, | |||
private val audioClientScope: CoroutineScope = CoroutineScope(Dispatchers.IO + SupervisorJob()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason we use SupervisorJob?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SupervisorJob is independent job, so any children of job failure will not impact this job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What use case would require that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for missing it, so you could end up having
CoroutineContext
CoroutineContext
CouroutineContext
In this case, if the parent fails somehow, the children will halt as well. If I understood correctly, SupervisorJob
prevents it and run it independently.
|
||
uiScope.launch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should double check with Ankit in case there's a reason we chose ui thread in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We couldn't find good reason. It might be because we wanted to have higher priority on starting by putting it on UI thread?
9656c68
to
204c19e
Compare
204c19e
to
02f5c5a
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
bf83c82
to
a9f4711
Compare
Issue #, if available:
#260
Description of changes:
Put audioClient start logic into different thread.
Testing done:
There are few test cases I have done
Theoretical side effect (not observed)
Instead of main thread, we are running on IO thread, so it could be possible that it is executed later.
Unit test coverage
Manual test cases (add more as needed):
Screenshots, if available:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.