use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.
the class RemotingTest method testHttpJson.
@Test
public void testHttpJson() throws Exception {
Coding coding = new Coding(SerializerType.JsonNoRef);
runtHttp(coding);
}
use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.
the class RemotingTest method testNIO.
@Test
public void testNIO() throws Exception {
Coding coding = new Coding(SerializerType.FSTSer);
runNio(coding);
}
use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.
the class RemotingTest method testBlocking.
@Test
public void testBlocking() throws Exception {
checkSequenceErrors = true;
RemotingTestService service = Actors.AsActor(RemotingTestService.class, Q_SIZE);
Coding coding = new Coding(SerializerType.FSTSer);
ActorServer publisher = TCPServerConnector.Publish(service, 8081, coding).await();
CountDownLatch latch = new CountDownLatch(1);
runnitTCP(latch, coding);
latch.await();
// wait for outstanding callbacks
Thread.sleep(2000);
publisher.close();
}
use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.
the class RemotingTest method testWS.
@Test
public void testWS() throws Exception {
Coding coding = new Coding(SerializerType.FSTSer);
runWS(coding);
}
use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.
the class HttpPublisher method publish.
@Override
public IPromise<ActorServer> publish(Consumer<Actor> disconnectCallback) {
ActorServer actorServer;
try {
Pair<PathHandler, Undertow> serverPair = Http4K.get().getServer(port, hostName);
UndertowHttpServerConnector con = new UndertowHttpServerConnector(facade);
con.setConnectionVerifier(connectionVerifier);
con.setSessionTimeout(sessionTimeout);
actorServer = new ActorServer(con, facade, coding == null ? new Coding(SerializerType.FSTSer) : coding);
con.setActorServer(actorServer);
actorServer.start(disconnectCallback);
serverPair.getFirst().addPrefixPath(urlPath, con);
} catch (Exception e) {
Log.Warn(null, e);
return new Promise<>(null, e);
}
return new Promise<>(actorServer);
}
Aggregations