Skip to content

Commit

Permalink
clean up Participants concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Jan 12, 2024
1 parent f02d4b7 commit 8c6c23b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/LiveKit/Core/Room.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,13 @@ extension Room {
.joined()
.compactMap { $0 }

for participant in allParticipants {
await participant.cleanUp(notify: _notify)
// Clean up Participants concurrently
await withTaskGroup(of: Void.self) { group in
for participant in allParticipants {
group.addTask {
await participant.cleanUp(notify: _notify)
}
}
}

_state.mutate {
Expand Down

0 comments on commit 8c6c23b

Please sign in to comment.