Open toomus opened 9 years ago
OK, so callback.call(message) must be in the end of incoming() and outgoing() functions, and can't be in any conditional instruction like 'if', and must appear only once in all function? To stop message from being sent, because of eg. authentication fail, we have to set message['error'] field in incoming() function. Then outgoing() function, when detect 'error' in message, stops processing that message and send another message with information, that something went wrong. Good explanation?
I have problem with callback.call(message). First my code:
application.rb
realtime_auth.rb
Whe i try to publish message to realtime_events channel i got this:
Outgoing message don't have data field but when i change RealtimeAuth incoming function to this:
Everything works:
Can someone explain why this don't work as expected? Thanks for help.