supabase-community / realtime-go

2 stars 3 forks source link

Implement Broadcast Feature #5

Open IcedTea2K opened 2 months ago

IcedTea2K commented 2 months ago

What kind of change does this PR introduce?

As part 2 of many PRs for https://github.com/supabase-community/realtime-go/issues/2, this PR implements broadcast functionalities. It should be merged and reviewed AFTER https://github.com/supabase-community/realtime-go/pull/4. More specifically:

What is the current behavior?

Client could only listen to postgres_changes right now, without being able to send any message to the server.

What is the new behavior?

Client could listen to broadcast events as well as send events to the server which will then be broadcasted to all listening clients.

Additional context

This is a simple echo client & server. There are two clients and two servers. As seen in the videos, messages sent from any client will be picked up by any server. Demo