mozilla / janus-plugin-sfu

Janus plugin to act as a kind of SFU for game networking data.
Mozilla Public License 2.0
135 stars 40 forks source link

Optimize block/unblock #90

Closed vincentfretin closed 2 years ago

vincentfretin commented 2 years ago

See #80 Now that get_publisher is optimized and cost is O(1) , prefer using it instead of iterating over publishers in the room to send the blocked/unblocked event to the blocked user. Well this may not be a big optimization, this is more for code readability and also to avoid having something like

        for room in &joined.room_ids {
            notify_user(&event, &whom, switchboard.publishers_occupying(&room));
        }

if a publisher is in several rooms, see https://github.com/mozilla/janus-plugin-sfu/issues/55#issuecomment-778065876 for context.

I tested it with the naf-adapter-janus example, the messages are still sent: Capture d’écran de 2021-07-10 11-37-52

vincentfretin commented 2 years ago

I merged this in master in networked-aframe fork https://github.com/networked-aframe/janus-plugin-sfu