Skip to content

Conversation

@IcedTea2K
Copy link
Contributor

@IcedTea2K IcedTea2K commented Jun 18, 2024

What kind of change does this PR introduce?

As part 2 of many PRs for #2, this PR implements broadcast functionalities. It should be merged and reviewed AFTER #4. More specifically:

  • 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.
Demo

@IcedTea2K IcedTea2K marked this pull request as ready for review June 19, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant