RealtimeChannel.Send() - a new function to send a broadcast message to the server. It takes in a CustomEvent struct.
RealtimeChannel.Subscribe() - can now listen to new broadcasted events
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.
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:
RealtimeChannel.Send()
- a new function to send a broadcast message to the server. It takes in aCustomEvent
struct.RealtimeChannel.Subscribe()
- can now listen to new broadcasted eventsWhat 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.