Search in sources :

Example 1 with ClusterListener

use of com.codingchili.core.listener.transport.ClusterListener in project chili-core by codingchili.

the class SystemContext method handler.

@Override
public Future<String> handler(Supplier<CoreHandler> handler) {
    ListenerSettings settings = new ListenerSettings();
    Promise<String> promise = Promise.promise();
    deployN(() -> new ClusterListener().settings(settings).handler(handler.get()), promise);
    return promise.future();
}
Also used : ClusterListener(com.codingchili.core.listener.transport.ClusterListener)

Example 2 with ClusterListener

use of com.codingchili.core.listener.transport.ClusterListener in project chili-core by codingchili.

the class ClusterListenerTest method setUp.

@Before
public void setUp(TestContext test) {
    Async async = test.async();
    this.context = new ContextMock();
    this.handler = new TestHandler(context, REPLY_ADDRESS);
    this.cluster = new ClusterListener().handler(handler).settings(new ListenerSettings());
    context.listener(() -> cluster).onComplete(done -> {
        if (done.failed()) {
            done.cause().printStackTrace();
        }
        test.assertTrue(done.succeeded());
        this.deployment = done.result();
        async.complete();
    });
}
Also used : Async(io.vertx.ext.unit.Async) ClusterListener(com.codingchili.core.listener.transport.ClusterListener) ContextMock(com.codingchili.core.testing.ContextMock)

Aggregations

ClusterListener (com.codingchili.core.listener.transport.ClusterListener)2 ContextMock (com.codingchili.core.testing.ContextMock)1 Async (io.vertx.ext.unit.Async)1