Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions livekit-rtc/livekit/rtc/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,12 @@ def on_participant_connected(participant):
# start listening to room events
self._task = self._loop.create_task(self._listen_task())

# unsubscribe from the FFI queue once the listen task ends.
# disconnect() unsubscribes too, but it early-returns when the
# room is already disconnected (e.g. removed remotely).
ffi_queue = self._ffi_queue
self._task.add_done_callback(lambda _: FfiClient.instance.queue.unsubscribe(ffi_queue))

# Unblock the FFI server once this SDK is ready to receive room events.
ready_req = proto_ffi.FfiRequest()
ready_req.ready_for_room_event.room_handle = self._ffi_handle.handle
Expand Down