use of sample.httpjs.MyHttpApp in project kontraktor by RuedigerMoeller.
the class KLoadTest method run.
public void run() {
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) -> {
myApp = (MyHttpApp) res;
myApp.login("dummy", "dummy").then((s, err1) -> {
session = s;
System.out.println("session connected " + session);
session.subscribe((result, e) -> {
count++;
lastBcast.set(System.currentTimeMillis());
});
});
});
}
use of sample.httpjs.MyHttpApp 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