Search in sources :

Example 6 with Coding

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);
}
Also used : Coding(org.nustaq.kontraktor.remoting.encoding.Coding) Test(org.junit.Test)

Example 7 with 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);
}
Also used : Coding(org.nustaq.kontraktor.remoting.encoding.Coding) Test(org.junit.Test)

Example 8 with 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();
}
Also used : ActorServer(org.nustaq.kontraktor.remoting.base.ActorServer) Coding(org.nustaq.kontraktor.remoting.encoding.Coding) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.Test)

Example 9 with Coding

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);
}
Also used : Coding(org.nustaq.kontraktor.remoting.encoding.Coding) Test(org.junit.Test)

Example 10 with 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);
}
Also used : Promise(org.nustaq.kontraktor.Promise) IPromise(org.nustaq.kontraktor.IPromise) ActorServer(org.nustaq.kontraktor.remoting.base.ActorServer) Coding(org.nustaq.kontraktor.remoting.encoding.Coding) PathHandler(io.undertow.server.handlers.PathHandler) Undertow(io.undertow.Undertow)

Aggregations

Coding (org.nustaq.kontraktor.remoting.encoding.Coding)10 Test (org.junit.Test)7 IPromise (org.nustaq.kontraktor.IPromise)2 ActorServer (org.nustaq.kontraktor.remoting.base.ActorServer)2 Undertow (io.undertow.Undertow)1 PathHandler (io.undertow.server.handlers.PathHandler)1 File (java.io.File)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Actor (org.nustaq.kontraktor.Actor)1 Promise (org.nustaq.kontraktor.Promise)1 CallerSideMethod (org.nustaq.kontraktor.annotations.CallerSideMethod)1 Local (org.nustaq.kontraktor.annotations.Local)1 SerializerType (org.nustaq.kontraktor.remoting.encoding.SerializerType)1 WebSocketPublisher (org.nustaq.kontraktor.remoting.http.undertow.WebSocketPublisher)1 WebSocketConnectable (org.nustaq.kontraktor.remoting.websockets.WebSocketConnectable)1