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

Broadcast to others #191

Merged
merged 2 commits into from
Oct 13, 2023
Merged

Broadcast to others #191

merged 2 commits into from
Oct 13, 2023

Conversation

palkan
Copy link
Member

@palkan palkan commented Oct 13, 2023

What is the purpose of this pull request?

This feature brings the ability to deliver broadcast events to everyone except the current session.

Based on anycable/anycable#218 and anycable/anycable-go#194

What changes did you make? (overview)

  • Extended Server#broadcast and Channel.broadcast_to methods to accept broadcast options as their third argument
  • Added AnyCable::Rails.broadcasting_to_other { } method to set the option for the inner code block (in case broadcast is called indirectly, e.g., with Turbo Streams)
  • Added Action Controller extension to set the current socket id from request headers
  • Added Active Job extensions to carry current_socket_id to jobs

Is there anything you'd like reviewers to focus on?

Checklist

  • I've added tests for this change
  • I've added a Changelog entry
  • I've updated documentation

@palkan palkan force-pushed the feat/broadcast-to-others branch from cfbeb7e to 9220ad4 Compare October 13, 2023 22:33
@palkan palkan force-pushed the feat/broadcast-to-others branch from 9220ad4 to c634349 Compare October 13, 2023 22:36
@palkan palkan marked this pull request as ready for review October 13, 2023 23:07
@palkan palkan merged commit 057cbb5 into master Oct 13, 2023
12 checks passed
@palkan palkan deleted the feat/broadcast-to-others branch October 13, 2023 23:22
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