class SocketIO::Client
- SocketIO::Client
- Reference
- Object
Defined in:
socket_io/socket_io.crConstructors
Instance Method Summary
-
#ack(*data, id : UInt64)
TODO should we consider replacing the Event class and this public method with a simpler callback approach?
- #close
- #connect(data = Hash(String, String).new)
- #disconnect
- #emit(event_name : String, *data)
- #emit_with_ack(event_name : String, *data, timeout : Time::Span = 30.seconds)
- #off(event_name : String, &block : EventHandler)
- #off(event_name : String)
- #on(event_name : String, &block : EventHandler)
Constructor Detail
def self.new(host : String, path : String = "/socket.io/", namespace : String = "/", base64 : Bool = false, decoder : Decoder = Decoders::BaseDecoder.new)
#
Instance Method Detail
def 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