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

documentation: Mention cable.yml adapter configuration #66

Closed
phillipspc opened this issue Aug 14, 2020 · 4 comments
Closed

documentation: Mention cable.yml adapter configuration #66

phillipspc opened this issue Aug 14, 2020 · 4 comments

Comments

@phillipspc
Copy link

phillipspc commented Aug 14, 2020

I was following along with the Setup documentation, just trying to get the most basic example to work, and was completely stumped. Nothing I did seemed to update the page. After much frustration, I nearly gave up on trying to use cable ready altogether, but luckily stumbled across a user post on this GoRails video: https://gorails.com/episodes/how-to-use-cable-ready mentioning the cable.yml file. So finally after changing my development environment to adapter: postgresql, everything started to work. It's not totally clear to me why the adapter: async was not working, so perhaps I'm missing something, but suffice it to say, changing this file was key to getting things setup.

I fully recognize that this is more of an ActionCable specific thing than a CableReady thing, but for me, part the appeal of CableReady is that it simplifies using ActionCable, aka, I don't need to be an ActionCable expert to use it. So all that said, since it seems like I'm not the first person to get hung up by this cable.yml config file, perhaps it's worth mentioning in the setup docs? Even a single line like:
"Be sure you're using the correct adapter in your config/cable.yml file"
would have helped me tremendously.

Just a suggestion. Happy to submit a PR to update the docs if that would help.

@leastbad
Copy link
Contributor

Hi Phillip! I am sorry to hear that you were having trouble, and I'm very glad that you got sorted out. It's a shame that you didn't come on Discord, as there's dozens of us waiting there to help.

It's true: ActionCable needs to be set up and working properly or else CableReady and StimulusReflex cannot work. That said, the AC docs are terrible. The good news is that there's not a ton you need to know about AC to get started with CR/SR, but that doesn't help you if you're stuck.

For what it's worth, the async adapter should work just fine. That said, as we can see on the GoRails comments, you're not the first person to run into this problem. Are you working on your localhost? Any virtualization or something that might be atypical?

Anyhow, the CableReady documentation is overdue for a major overhaul. It's coming, and I will certainly add information about cable.yml.

@phillipspc
Copy link
Author

@leastbad thanks for the reply. I'll definitely check out the Discord in the future.
To follow up, I don't think there's anything too atypical about my setup. I was trying to trigger DOM updates via CableReady both from the rails console and from active job. Neither worked at first. Switching to adapter: postgresql immediately got it working from the console.
I was still having issues from ActiveJob, but I was trying out GoodJob, which is very new, and sure enough switching to DelayedJob has gotten it working via background jobs. 🤷

Thanks again, looking forward to the updated docs, and using CableReady more!

@leastbad
Copy link
Contributor

I saw GoodJob's announcement but I am a Redis/Sidekiq enthusiast. If you're going into production, I would strongly consider using Redis/Sidekiq for caching, jobs and Action Cable.

@henrydjacob
Copy link

@phillipspc did you got it work on GoodJob or DelayedJob

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

3 participants