Repository navigation
Data tracks: publishing - #991
Conversation
5db4c9f to
8a5d82c
Compare
6bf5d50 to
ba27476
Compare
ba27476 to
45535a7
Compare
45535a7 to
75474d6
Compare
492304c to
1c91a15
Compare
boks1971
left a comment
There was a problem hiding this comment.
I have not reviewed local.go and local_test.go yet. But, I am stopping here for some comments and pick it up later after your response.
Some notes
- I think
localDataTracksshould be movedLocalParticipantfully if possible. It should just follow the media track pattern. At room level, I don't think it should be dealing with tracks. It should be dealing with only participants and tracks should live at participant. We should look at it more closely if that is not possible for some reason (I am going to leave the same comment in the subscribe PR where remote tracks if possible should be managed inside theRemoteParticipant) - Because I have not fully ready the above files, I am not sure of the
LocalManager(and similarlyRemoteManager's roles). But for abstraction and making things private, you can do something like
type LocalManager interface {
// only publicly needed methods here
}
type localManager struct {
// the implementation which is package private
}
var _ LocalManager = (*localManager)(nil) // compiler trick to ensure that localManager implements the LocalManager interface.
func NewLocalManager() LocalManager{
}
481afac to
f656c06
Compare
Some additional context: the data tracks implementations follow a pattern that is gradually being adopted by the other client SDKs as part of the effort to break up the monolithic room and participant objects. The main idea is each independent feature in a room (publishing data tracks, subscribing to data tracks, RPC, etc.) keeps all of its state and business logic in one manager, separate from the the objects that comprise the public API (room, local participant, remote participant, etc.). One benefit is that each manager can be unit tested in isolation without constructing a room or connecting to an SFU. This also allows test cases to be standardized across implementations and audited to ensure they are equivalent. For reference, here are the local manager test suites for the other implementations:
The role of each manager:
We could move Curious to hear your thoughts given this additional context. |
Sorry about the delay on this. That sounds good to me @ladvoc . I will read through those two managers and drop any feedback. I am thinking Ideally, I would do a |
f656c06 to
a5467d5
Compare
There was a problem hiding this comment.
Devin Review found 4 new potential issues.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Remove seperate atomic
a5467d5 to
953bf0c
Compare
Add support for publishing data tracks.
Architecture and public API closely match Rust and JS clients:
LocalParticipant.PublishDataTrackAPI.LocalManagermanages internal state and transitions for all local data tracks.Closes BOT-541