Amber::WebSockets::ClientSocket
ClientSocket struct maps a user to an HTTP::WebSocket. For every websocket connection
there will be an associated ClientSocket. Authentication and authorization happen within the ClientSocket. ClientSocket will subscribe to Channels,
where incoming and outgoing messages are routed through.
Example:
struct UserSocket < Amber::Websockets::ClientSocket
channel "user_channel:*", UserChannel
channel "room_channel:*", RoomChannel
def on_connect
return some_auth_method!
end
end
Constants
BEAT_INTERVAL = 30.seconds
Log = ::Log.for(self)
MAX_SOCKET_IDLE_TIME = 100.seconds
Constructors
Class methods
Broadcast a message to all subscribers of the topic
UserSocket.broadcast("message", "chats_room:1", "msg:new", {"message" => "test"})
channels
Sourceget_topic_channel(topic_path)
SourceInstance methods
socket
Source