title: How to receive data in ActionCable Channel without JS?
body: <p>I'm writing a Rails application that uses WebSockets to communicate with other machines (no browser and client side logic in this process). I have a channel:</p>
  
  <pre><code>class MachinesChannel &lt; ApplicationCable::Channel
    def subscribed
      ...
    end
  
    def unsubscribed
      ...
    end
  
    def handle_messages
      ...
    end
  end
  </code></pre>
  
  <p>To receive the data the only way I know about is the JavaScript client:</p>
  
  <pre><code>ActionCable.createConsumer('/cable').subscriptions.create 'MachinesChannel',
    received: (message) -&gt;
      @perform('handle_messages')
  </code></pre>
  
  <p>I can call server side methods from JS via <code>@perform()</code> method.</p>
  
  <p>Is there any way to omit the JS part and somehow directly handle the incoming data in <code>MachinesChannel</code>?</p>
  
  <p>The ideal situation would be to have the <code>handle_messages</code> method accept a <code>data</code> argument and have this metod called on incoming data.</p>