Search in sources :

Example 1 with ActorPublisher

use of org.nustaq.kontraktor.remoting.base.ActorPublisher in project kontraktor by RuedigerMoeller.

the class Routing method start.

// ////////////////////////////////////////////////// static API /////////////////////////////////////////////
// 
// 
/**
 * start a Krouter
 * @param krouterClass
 * @param publisher
 * @param <T>
 * @return
 */
public static <T extends AbstractKrouter> T start(Class<T> krouterClass, ActorPublisher... publisher) {
    T res = AsActor(krouterClass);
    res.init();
    for (int i = 0; i < publisher.length; i++) {
        ActorPublisher actorPublisher = publisher[i].facade(res);
        actorPublisher.publish(act -> {
            res.handleServiceDiscon(act);
        });
    }
    return res;
}
Also used : ActorPublisher(org.nustaq.kontraktor.remoting.base.ActorPublisher)

Aggregations

ActorPublisher (org.nustaq.kontraktor.remoting.base.ActorPublisher)1