use of service.common.MyServiceInterface in project kontraktor by RuedigerMoeller.
the class MyServiceServerImpl method main.
public static void main(String[] a) {
// give large queue to service
MyServiceInterface myService = Actors.AsActor(MyServiceServerImpl.class, 128_000);
new TCPNIOPublisher().facade(myService).port(6789).serType(SerializerType.FSTSer).publish().await();
System.out.println("server started on " + 6789);
}
use of service.common.MyServiceInterface in project kontraktor by RuedigerMoeller.
the class ServiceClient method run.
public void run() {
MyServiceInterface service = (MyServiceInterface) new TCPConnectable().actorClass(MyServiceInterface.class).host("localhost").port(6789).connect((connector, error) -> {
System.out.println("Disconnected from service .. exiting");
System.exit(0);
}).await();
service.addPerson(new Person("Hickory", "Heinz", 13, Sex.MALE));
service.addPerson(new Person("Blob", "Jim", 13, Sex.MALE));
service.addPerson(new Person("Gerstenbroich-Huckerbühl", "Mareike", 17, Sex.MALE));
service.listPersons(null, null, 13, (p, err) -> {
if (!Actor.isErrorOrComplete(err))
System.out.println("found: " + p);
else {
System.out.println("query finished");
System.exit(0);
}
});
}
Aggregations