use of sample.httpjs.MyHttpAppSession in project kontraktor by RuedigerMoeller.
the class TestCrashClose method main.
public static void main(String[] args) {
boolean http = false;
ConnectableActor connectable;
if (!http) {
connectable = new WebSocketConnectable(MyHttpApp.class, "ws://localhost:8080/ws").serType(SerializerType.JsonNoRef);
} else {
connectable = new HttpConnectable(MyHttpApp.class, "http://localhost:8080/api").serType(SerializerType.JsonNoRef);
}
connectable.connect((connector, error) -> {
System.out.println("connection lost " + connector);
}).then((res, err) -> {
MyHttpApp myApp = (MyHttpApp) res;
myApp.login("dummy", "dummy").then((s, err1) -> {
MyHttpAppSession session = s;
System.out.println("session connected " + session);
session.subscribe((result, e) -> {
System.exit(0);
});
});
});
}
Aggregations