Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Broadcast Feature #5

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

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