T - public interface Function<T>
class Function<IOException>() {
public void on(IOEXception ex) {
}
}
This function can be registered using the Socket.on(Function) as
socket.on(new Function<IOEXception>() {
....
}
This is the equivalent of doing
socket.on(Event.ERROR, new Function<IOEXception>() {
....
}
Anonymous functions call also be invoked if a Decoder match its type
socket.decoder(new Decoder<String, POJO>(){
@Override
public POJO decode(Event e, String message) {
return new POJO(message);
}
}
.on(new Function<POJO>() {
....
}
void on(T t)
t - A function that will be invoked when a object of type T is defined.Copyright © 2015. All Rights Reserved.