ruby-on-rails - 单独服务器中的任何电缆

标签 ruby-on-rails go actioncable

我的 rails 在服务器 A 中,我创建了一个安装了 Go-lang 的单独服务器

我的目标是将 Anycable-Go 与 Rails 一起使用,但在单独的服务器中。

我真的无法在谷歌中找到任何明确的解释如何做到这一点,但来自 doc我在“Go”服务器中尝试了以下操作:

go get -u -f github.com/anycable/anycable-go/cmd/anycable-go

然后

anycable-go --rpc_host=0.0.0.0:50051 --headers=cookie,x-api-token \
              --redis_url=redis://{my_redis_username}:{my_redis_password}@{my_redis_machine_url} --redis_channel=anycable \
              --host=0.0.0.0 --port=8084

输出看起来像这样:

enter image description here

到目前为止,我真的不确定我是否在正确的 rails 上......但如果是这样,应该如何让我的 Rails 应用程序连接/使用这个“有线转接”服务器?

最佳答案

您需要将 anycable-rails gem 添加到您的应用程序,并与 Rails 服务器一起运行 AnyCable RPC 服务器(bundle exec anycable)。参见 https://docs.anycable.io/#/using_with_rails

关于ruby-on-rails - 单独服务器中的任何电缆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53904013/

相关文章:

mysql - Rails 连接池如何工作?

Golang kubernetes 客户端 - 使用标签修补现有资源

ruby-on-rails - Rails API 应用程序中 ActionCable 的 Websocket 客户端

使用 Action-Cable 的 Ruby-on-Rails 应用程序在开发中运行,但在生产模式中失败

ios - 当 iOS 客户端发送 "unsubscribe"时,ActionCable 取消订阅回调不起作用

ruby-on-rails - 重定向到某个页面而不是 :notice when non-confirmed user logs in

ruby-on-rails - rails/Prawn : how do I use rails helpers inside a Prawn class?

go - 如何调用自定义dll文件中的函数

python - 直接调用与 Python 子进程时 GOPATH 的解释不同

ruby-on-rails - 在不同服务器上使用 Rails 的 postgresql COPY 命令的问题