Skip to content

Commit

Permalink
RTC-520 Add PeerAdded and PeerDeleted notifications (#37)
Browse files Browse the repository at this point in the history
* Add PeerAdded and PeerDeleted notifications

* Update protos
  • Loading branch information
Rados13 authored Apr 23, 2024
1 parent 131186b commit 25c6e5a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jellyfish/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
ServerMessageComponentCrashed,
ServerMessageHlsPlayable,
ServerMessageMetricsReport,
ServerMessagePeerAdded,
ServerMessagePeerConnected,
ServerMessagePeerCrashed,
ServerMessagePeerDeleted,
ServerMessagePeerDisconnected,
ServerMessageRoomCrashed,
ServerMessageRoomCreated,
Expand All @@ -24,7 +26,9 @@
"ServerMessageRoomCreated",
"ServerMessageRoomDeleted",
"ServerMessageRoomCrashed",
"ServerMessagePeerAdded",
"ServerMessagePeerConnected",
"ServerMessagePeerDeleted",
"ServerMessagePeerDisconnected",
"ServerMessagePeerCrashed",
"ServerMessageComponentCrashed",
Expand Down
23 changes: 23 additions & 0 deletions jellyfish/events/_protos/jellyfish/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protos
8 changes: 8 additions & 0 deletions tests/test_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
from jellyfish import ComponentOptionsFile, Notifier, PeerOptionsWebRTC, RoomApi
from jellyfish.events import (
ServerMessageMetricsReport,
ServerMessagePeerAdded,
ServerMessagePeerConnected,
ServerMessagePeerDeleted,
ServerMessagePeerDisconnected,
ServerMessageRoomCreated,
ServerMessageRoomDeleted,
Expand Down Expand Up @@ -121,8 +123,10 @@ async def test_peer_connected_disconnected(
):
event_checks = [
ServerMessageRoomCreated,
ServerMessagePeerAdded,
ServerMessagePeerConnected,
ServerMessagePeerDisconnected,
ServerMessagePeerDeleted,
ServerMessageRoomDeleted,
]
assert_task = asyncio.create_task(assert_events(notifier, event_checks.copy()))
Expand Down Expand Up @@ -156,8 +160,10 @@ async def test_peer_connected_disconnected_deleted(
):
event_checks = [
ServerMessageRoomCreated,
ServerMessagePeerAdded,
ServerMessagePeerConnected,
ServerMessagePeerDisconnected,
ServerMessagePeerDeleted,
ServerMessageRoomDeleted,
]

Expand Down Expand Up @@ -194,7 +200,9 @@ async def test_peer_connected_room_deleted(
):
event_checks = [
ServerMessageRoomCreated,
ServerMessagePeerAdded,
ServerMessagePeerConnected,
ServerMessagePeerDeleted,
ServerMessageRoomDeleted,
]
assert_task = asyncio.create_task(assert_events(notifier, event_checks.copy()))
Expand Down

0 comments on commit 25c6e5a

Please sign in to comment.