Search in sources :

Example 1 with Coding

use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.

the class BrowseriBabelify method get.

public static BrowseriBabelify get() {
    synchronized (BrowseriBabelify.class) {
        if (singleton == null) {
            WebSocketConnectable webSocketConnectable = new WebSocketConnectable(BrowseriBabelify.class, url).coding(new Coding(SerializerType.JsonNoRef, BabelResult.class, BabelOpts.class));
            singleton = (BrowseriBabelify) webSocketConnectable.connect((xy, e) -> System.out.println("disconnected " + xy)).await(1000);
        }
    }
    return singleton;
}
Also used : IPromise(org.nustaq.kontraktor.IPromise) SerializerType(org.nustaq.kontraktor.remoting.encoding.SerializerType) CallerSideMethod(org.nustaq.kontraktor.annotations.CallerSideMethod) Actor(org.nustaq.kontraktor.Actor) WebSocketConnectable(org.nustaq.kontraktor.remoting.websockets.WebSocketConnectable) Local(org.nustaq.kontraktor.annotations.Local) File(java.io.File) Coding(org.nustaq.kontraktor.remoting.encoding.Coding) Coding(org.nustaq.kontraktor.remoting.encoding.Coding) WebSocketConnectable(org.nustaq.kontraktor.remoting.websockets.WebSocketConnectable)

Example 2 with Coding

use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.

the class Service4Node method main.

public static void main(String[] args) {
    // ensure we see also IO/close exceptions
    Log.setLevel(Log.DEBUG);
    Service4Node service = Actors.AsActor(Service4Node.class);
    new WebSocketPublisher(service, "localhost", "/s4n", 8080).coding(new Coding(SerializerType.JsonNoRef, Pojo2Node.class)).sendStringMessages(true).publish(actor -> {
        System.exit(0);
    });
}
Also used : Coding(org.nustaq.kontraktor.remoting.encoding.Coding) WebSocketPublisher(org.nustaq.kontraktor.remoting.http.undertow.WebSocketPublisher)

Example 3 with Coding

use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.

the class RemotingTest method testHttp.

@Test
public void testHttp() throws Exception {
    Coding coding = new Coding(SerializerType.FSTSer);
    runtHttp(coding);
}
Also used : Coding(org.nustaq.kontraktor.remoting.encoding.Coding) Test(org.junit.Test)

Example 4 with Coding

use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.

the class RemotingTest method testNIOJSon.

@Test
public void testNIOJSon() throws Exception {
    Coding coding = new Coding(SerializerType.JsonNoRef);
    runNio(coding);
}
Also used : Coding(org.nustaq.kontraktor.remoting.encoding.Coding) Test(org.junit.Test)

Example 5 with Coding

use of org.nustaq.kontraktor.remoting.encoding.Coding in project kontraktor by RuedigerMoeller.

the class RemotingTest method testWSJson.

@Test
public void testWSJson() throws Exception {
    Coding coding = new Coding(SerializerType.JsonNoRef);
    runWS(coding);
}
Also used : Coding(org.nustaq.kontraktor.remoting.encoding.Coding) Test(org.junit.Test)

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