Is there a way to send request status to a client in ActionCable Channels?
For example, if the data sent is invalid (or some unknown exception was raised), I want the error text in the response message, otherwise send 'status: ok'. Now I have a client-side subscriber method to perform that returns true in almost all circumstances, as we can see from the source code ( github ):
send: (data) ->
if @isOpen()
@webSocket.send(JSON.stringify(data))
true
else
false
In websocket-rails gem there were methods for this: trigger_failure and trigger_success ,
source
share