@Override public void onRead(HandlerContext ctx, Object msg) { if (msg instanceof Invocation) { onInvocation(ctx, (Invocation) msg); } else { ctx.fireRead(msg); } }
@Override public Task connect(final HandlerContext ctx, final Object param) throws Exception { clusterPeer.registerMessageReceiver((n, m) -> ctx.fireRead(Pair.of(n, m))); return clusterPeer.join(clusterName, nodeName).thenRun(() -> ctx.fireActive()); }