membraneframework-labs / membrane_live

Webinar app in React, Phoenix and Membrane
Apache License 2.0
12 stars 2 forks source link

add event-controller #191

Closed Karolk99 closed 1 year ago

Karolk99 commented 1 year ago

This PR is part of the migration of MembraneLive to Jellyfish.

To better understand my motivation behind this PR: There were two modules responsible for keeping track of a webinar state: MembraneLive.Event and MebraneLiveWeb.EventChannel.

Logic connected to maintaining webinars is partly in EventChannel which doesn't have its own state (only Presence which keeps the state of each user). The other part is inside Event which doesn't have the full state of the event because it's only responsible for the stream, not the whole event.

That's why I renamed Event to Room because it's only responsible for a stream, not the whole Event. I also created a new module named RoomController which is responsible for controlling live times of events. This way all the logic is in one place which is way better and easier to maintain.

Maybe in the future, It would be better to create one module responsible for both streaming and controlling event but I don't think it should be a concern of this PR.

This PR will also make it easier to rewrite Room to Jellyfish.

Karolk99 commented 1 year ago

I will add tests as soon as I can.