Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Piotr Domagała
    @naku-i386
    @palkan Understand! Thank you very much <3
    Piotr Domagała
    @naku-i386
    Hah, i stumbled upon the same issue @patricklu10_twitter had. I think you need to yell in the docs: Set the same redis channel name! :D
    I eagerly copied the command from anycable-go github and expected it to work ;-( my bad
    Vladimir Dementyev
    @palkan
    yeah, that's the most popular issue(
    maybe, we should remove the default value at all to force everyone to add one
    Piotr Domagała
    @naku-i386
    Good idea imho! Remove any sign of "__anycable__". Funny thing is that when i saw "__anycable__" in rails and just "anycable" in anycable-go i thought it will point to the same channel but it's just different convention or smth... Wrong assumption.
    Vladimir Dementyev
    @palkan

    @/all Hey everyone!

    Here is the survey for AnyCable users: https://evilmartians.typeform.com/to/W35uRm.

    We want to learn more about you to make this piece of software better)

    justin talbott
    @waymondo
    hi there, I work at a company and we are considering making the switch from ActionCable to AnyCable. our app runs on Heroku and i noticed your Heroku Deployment wiki page: https://github.com/anycable/anycable/wiki/Heroku-Deployment. on it, its stated that AnyCable relies on HTTP/2 but Heroku doesn't support it. how do the steps below allow one to bypass that issue?
    Vladimir Dementyev
    @palkan

    Hi!

    how do the steps below allow one to bypass that issue?

    The described configuration assumes that you run both AnyCable RPC and AnyCable-Go on the same dyno. Thus HTTP2 traffic is running locally and is not affected by Heroku limitations.

    Also, check the newer version of the docs: https://docs.anycable.io/#/heroku

    justin talbott
    @waymondo
    cool, thank you. that explanation makes a lot of sense. i will check out these newer docs. i shall be back if i have more questions. thanks for your time
    Arthur Del Esposte
    @arthurmde_gitlab
    @palkan Hi! Does Anycable have a health check mechanism/endpoint/method that I could use in my Rails app? I'm creating endpoints in my app to check if everything is up and running properly and I want to check if it is everything ok with Anycable server. I was not able to find anything related in the docs =/
    Vladimir Dementyev
    @palkan
    Hey! Yes, we have health checks for both RPC and WebSocket servers: one and two.
    Arthur Del Esposte
    @arthurmde_gitlab
    thank you ;)
    Sean
    @seanfcarroll
    Is it possible to see the Dockerfile that was used to build https://hub.docker.com/r/anycable/anycable-go ? It seems to be using post 8080 instead of 3334 ... is there a reason for that.
    Why do you think it should use 3334?
    Yunzheng
    @42thcoder
    @palkan hey, I want to build a ws server using Java. Is that welcome? just like anycable-go
    Vladimir Dementyev
    @palkan
    Hey! Sure, that will be great 👍
    Arthur Del Esposte
    @arthurmde_gitlab
    Hello. Is there any easy way to get the list of open connections of the server? Context: I want to track online users through open WS connections, which will be checked/managed by a worker periodically.
    Arthur Del Esposte
    @arthurmde_gitlab
    I think I should use ActionCable.server.remote_connections. However, I can't get the (iterable) list of connections from it since AFAIK it is intended to disconnect a given connection through an identifier.
    Vladimir Dementyev
    @palkan

    Hi!
    Currently, AnyCable provides this information only via anycable-go server instrumentation: http://docs.anycable.io/#/anycable-go/instrumentation

    If you want to get this information from the Ruby app, you can make an HTTP request to the metrics endpoint and grab the anycable_go_clients_num from there.

    Arthur Del Esposte
    @arthurmde_gitlab
    @palkan thanks for answering =)
    Taha Ali Irfan
    @tahaali_gitlab
    Hi Guys,
    I am trying to install anycable-go on ubuntu 18.04, but running the following command doesn't do anything
    go get -u -f github.com/anycable/anycable-go/cmd/anycable-go
    can someone please help
    Vladimir Dementyev
    @palkan
    Hey!
    What is your Go version? And what is the output for this command?
    Taha Ali Irfan
    @tahaali_gitlab
    go1.13.1 linux/amd64
    The above is my go version
    Taha Ali Irfan
    @tahaali_gitlab
    @palkan
    Vladimir Dementyev
    @palkan
    Try adding GO111MODULE=on before the command:
    GO111MODULE=on go get -u -f github.com/anycable/anycable-go/cmd/anycable-go
    Cedric Loy
    @seraphimlord
    Hey guys, do you have any tutorials on running anycable-go as a background service?
    Vladimir Dementyev
    @palkan
    Hey!
    Yeah, we recommend using systemd: http://docs.anycable.io/#/deployment/systemd
    Arthur Del Esposte
    @arthurmde_gitlab

    Hi everyone. I have a design question. We are splitting our monolithic backend into smaller services. Suppose I have two Rails services (let's say A and B). Service A already uses AnyCable, handling the connection and providing some channels used by our Frontend. I want to make Service B broadcast some events through the same WS connection. It may implement a different Channel, for instance, a specific channel that only concerns the code of Service B. To this end, I think I can use the structure of the ActionCable's channels on Service B, right?

    However, I think it does not make sense to implement any connection logic in Service B since Service A is already handling connections and authentication. What do you suggest?

    Does anyone have experience in using a single WS server for multiple services (with different codebases)?

    thanks =)
    Arthur Del Esposte
    @arthurmde_gitlab
    Or the best option would be deploying a WS server for each service a make the Frontend handle two WS URLs/connections?
    Vladimir Dementyev
    @palkan

    Hey!
    That’s an interesting case.

    Right now, out-of-the-box, the best option is to have a connection/server per service.

    In theory, it’s possible to create a custom AnyCable-Go build with a kinda RPC routing: connect some channels to Service A and others to Service B. So, you’ll have two RPC servers, for each service, but only one WS server and thus, a single WS connection per client.

    That’s something I have in mind for the future versions, to make this “routing” configurable and out-of-the-box. Currently, the only way to do this is to fork the project and write some Go code 🙂

    Arthur Del Esposte
    @arthurmde_gitlab
    Good to hear that. I will follow your suggestion.
    Arthur Del Esposte
    @arthurmde_gitlab
    Also, it's really nice that you have been thinking about it for future versions. There is a lack of documentation and patterns on how to handle WebSocket in Microservices architecture. The more services you have, the more complex your client becomes as it has to handle multiple WS connections instead of a single connection.
    IMO a routing feature based on WS channels would work similarly to API Gateway for HTTP requests, which is interesting.
    Anyway, I need to get more familiar with the Anycable's source code to be able to contribute in this sense
    Miguel Michelson Martinez
    @michelson
    Hi Guys , I've implemented anycable on production and I've noted that instance variables are not compatible! so my question is how can I manage that ?
    class EventsChannel < ApplicationCable::Channel
    
      def subscribed
        @app  = App.find_by(key: params[:app])
        @user_data = get_user_data
        @app_user = find_user
        stream_from "messenger_events:#{@app.key}-#{@app_user.session_id}"
      end
    
      def  send_message(options)
        options.delete("action")
        @app_user.visits.create(options) ## here it raise error, @app_user is nil
      end
    Miguel Michelson Martinez
    @michelson

    should I query again the authorization ,like something like this ?

      def  send_message(options)
       @app  = App.find_by(key: params[:app])
        @user_data = get_user_data
        @app_user = find_user
        @app_user.visits.create(options)
      end

    well.. I can confirm that way will work, but it does not feel all right because I will authorize on every message, that will generate many queries to the database

    I hope anyone can give some light on this issue
    Vladimir Dementyev
    @palkan

    Hi!
    Yeah, instance variables are not supported.

    You can perform authorization once only in subscribed method, and only fetch user and app records in send_message (from params). However I’m not quite sure by authorization.

    Also, authorizing every action makes more sense: a user might have lost the access to the app but the connection is still open, so sending messages is possible.

    Miguel Michelson Martinez
    @michelson
    Hi Vladimir, Thanks for your reply. so , what you are suggesting is move the part of the user auth/fetch to every method, right ?
     def  send_message(options)
       @app  = App.find_by(key: params[:app])
        @user_data = get_user_data
        @app_user = find_user
        @app_user.visits.create(options)
      end
    Miguel Michelson Martinez
    @michelson
    I don't like the idea very much, just because this way will hit the database a lot more than vanilla actioncable. is there no other way?
    Miguel Michelson Martinez
    @michelson
    maybe some kind of setter on the channel class, like an id attribute. to be used in channel methods and simplifiyng queries, like User.find(id)
    Vladimir Dementyev
    @palkan
    Yeah, that’s something we plan for v1.0, which is planned for Early 2020; maybe, even full instance variables support
    Miguel Michelson Martinez
    @michelson
    Hi @palkan , that's sounds great. I guess full instance support will consume a lot of RAM
    Miguel Michelson Martinez
    @michelson
    I will be more than happy if you can manage simple int, but I will be stay tuned for your news! awesome project