Skip to content

Commit

Permalink
Refactored syncmutex comments for realtime_presence
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Dec 5, 2023
1 parent 14252e8 commit e4ef0ce
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ably/realtime_presence.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ func newRealtimePresence(channel *RealtimeChannel) *RealtimePresence {
syncDone: make(chan struct{}),
}
pres.queue = newMsgQueue(pres.channel.client.Connection)
// Lock syncMtx to make all callers to Get(true) wait until the presence
// is in initial sync state. This is to not make them early return
// with an empty presence list before channel attaches.
return pres
}

Expand Down Expand Up @@ -202,8 +199,7 @@ func (pres *RealtimePresence) syncStart() {
if pres.syncState == syncInProgress {
return
} else if pres.syncState != syncInitial {
// Sync has started, make all callers to Get(true) wait. If it's channel's
// initial sync, the callers are already waiting.
// Start new sync after previous one was finished
pres.syncDone = make(chan struct{})
}
pres.syncState = syncInProgress
Expand Down

0 comments on commit e4ef0ce

Please sign in to comment.