SocketIO::Client
Inherits Reference < Object
Constructors
new(host : String, path : String = "/socket.io/", namespace : String = "/", base64 : Bool = false, decoder : Decoder = Decoders::BaseDecoder.new)
SourceInstance methods
ack(*data, id : UInt64)
TODO: should we consider replacing the Event class and this public method with a simpler callback approach?
-socket.on("request") do |event|
+socket.on("request") do |data, callback|
# ...
- event.ack({
+ callback.call({
# ...
})
end
close
Sourcedisconnect
Sourceemit(event_name : String, *data)
Sourceemit_with_ack(event_name : String, *data, timeout : Time::Span = 30.seconds)
Sourceoff(event_name : String, &block : EventHandler)
Sourceoff(event_name : String)
Sourceon(event_name : String, &block : EventHandler)
Source