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

ActionCable.server.config.pubsub_adapter always constantize? #1

Open
ioquatix opened this issue Nov 16, 2024 · 2 comments
Open

ActionCable.server.config.pubsub_adapter always constantize? #1

ioquatix opened this issue Nov 16, 2024 · 2 comments

Comments

@ioquatix
Copy link

I wonder if we can make this easier to configure?

I wanted to use something other than an adapter under ActionCable::SubscriptionAdapter::.

return @pubsub_adapter.constantize if @pubsub_adapter

I don't have much idea about what could be better.

@ioquatix
Copy link
Author

Maybe we need to introduce a server configuration class that can be overridden, e.g. to set reasonable defaults or change default behaviour. For example, the executor, and the pubsub adapter instance, etc.

@palkan
Copy link
Member

palkan commented Nov 25, 2024

I wanted to use something other than an adapter under ActionCable::SubscriptionAdapter::.

I added this line exactly to quick-solve this problem. You can use any class name is the value now. But having something like the following would be great, too:

# Pass any object
config.action_cable.pubsub_adapter = MyAdapter.new

# Pass a class name
config.action_cable.pubsub_adapter = "MyAdapter"

# Pass an identifier with options (current official behaviour)
config.action_cable.pubsub_adapter = :redis, url: "redis://localhost:50051"

Actually, I don't really understand why do we have cable.yml at all 🤷‍♂️

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

No branches or pull requests

2 participants