Channel
Extending Channel
class MyChannel < Azu::Channel
PATH = "/ws/path"
def on_connect
# Handle connection
end
def on_message(message : String)
# Handle message
end
def on_close(code, reason)
# Handle disconnection
end
endClass Constants
PATH
Lifecycle Methods
on_connect
on_message
on_close
on_error
Instance Methods
socket
send
close
context
params
headers
Broadcasting
Class-level broadcasting
Broadcast to others
Room Management
Authentication
Message Handling Pattern
Complete Example
See Also
Last updated
Was this helpful?
