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

Participant Composite #474

Merged
merged 23 commits into from
Sep 8, 2023
Merged

Participant Composite #474

merged 23 commits into from
Sep 8, 2023

Conversation

frostbyte73
Copy link
Member

No description provided.

@frostbyte73 frostbyte73 marked this pull request as ready for review September 7, 2023 01:49
Copy link
Contributor

@biglittlebigben biglittlebigben left a comment

Choose a reason for hiding this comment

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

Great! I think we may just consider relying a bit more on contexts for some of the cancellation/timeout handling.

stateErr <- b.bin.SetState(state)
}()
select {
case <-time.After(stateChangeTimeout):
Copy link
Contributor

Choose a reason for hiding this comment

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

Would a context help here?

Copy link
Member Author

Choose a reason for hiding this comment

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

if you're passing the context into other functions/doing more with deadlines I'd agree, but for simple cases like this I prefer the simplicity of time.After. One line less without the defer cancel()

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed. My point would be that I think that ideal (b *Bin) SetState (and potentially callers as well) should take a context as well, allowing the caller to cancel the wait on timeout.

Retrofitting all this is beyond the scope of this PR, of course.

}

select {
case <-time.After(stateChangeTimeout):
Copy link
Contributor

Choose a reason for hiding this comment

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

A context may be a bit more straightforward here as well.

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

nice!

@@ -326,16 +380,21 @@ func (s *SDKSource) onTrackSubscribed(track *webrtc.TrackRemote, pub *lksdk.Remo
if !s.initialized.IsBroken() {
s.mu.Lock()
switch s.RequestType {
case types.RequestTypeParticipant:
s.filenameReplacements["{publisher_identity}"] = s.Identity
Copy link
Member

Choose a reason for hiding this comment

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

would we make pID a replacement policy too? not sure if that needs to be onTrackSubscribed tho.

Copy link
Member Author

Choose a reason for hiding this comment

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

could add ID if/when someone asks, I think for the most part identity is more useful

Copy link
Member

Choose a reason for hiding this comment

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

yeah you are right.. this is participant composite.. identity is the main thing people would care about.

@frostbyte73 frostbyte73 merged commit 6507083 into main Sep 8, 2023
@frostbyte73 frostbyte73 deleted the participant-composite branch September 8, 2023 23:14
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