akka.routing.Router Java Examples

The following examples show how to use akka.routing.Router. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HeartBeatActor.java    From Nickle-Scheduler with Apache License 2.0 5 votes vote down vote up
public HeartBeatActor(Router masterRouter, ActorRef dispatcherActor) {
    Config config = getContext().getSystem().settings().config();
    ConfigObject configObject = config.getObject("akka.remote.netty.tcp");
    localHostName = configObject.get("hostname").unwrapped().toString();
    localPort = Integer.valueOf(configObject.get("port").unwrapped().toString());
    this.masterRouter = masterRouter;
    this.dispatcherActor = dispatcherActor;
}
 
Example #2
Source File: Simulator.java    From caffeine with Apache License 2.0 5 votes vote down vote up
public Simulator() {
  Config config = context().system().settings().config().getConfig("caffeine.simulator");
  settings = new BasicSettings(config);
  traceReader = makeTraceReader();

  List<Routee> routes = makeRoutes();
  router = new Router(new BroadcastRoutingLogic(), routes);
  remaining = routes.size();

  batchSize = settings.batchSize();
  stopwatch = Stopwatch.createStarted();
  reporter = settings.report().format().create(config);
}
 
Example #3
Source File: ActorFuture.java    From Nickle-Scheduler with Apache License 2.0 4 votes vote down vote up
private SenderFutureTask(Router router, Object msg, ActorContext actorContext) {
    this.router = router;
    this.msg = msg;
    this.actorContext = actorContext;
}
 
Example #4
Source File: ActorFuture.java    From Nickle-Scheduler with Apache License 2.0 4 votes vote down vote up
public SenderActor(Router router, Object msg, SenderFutureTask senderFutureTask) {
    this.router = router;
    this.msg = msg;
    this.senderFutureTask = senderFutureTask;
}
 
Example #5
Source File: ActorFuture.java    From Nickle-Scheduler with Apache License 2.0 4 votes vote down vote up
public static Props props(Router router, Object msg, SenderFutureTask senderFutureTask) {
    return Props.create(SenderActor.class, router, msg, senderFutureTask);
}
 
Example #6
Source File: HeartBeatActor.java    From Nickle-Scheduler with Apache License 2.0 4 votes vote down vote up
public static Props props(Router masterRouter, ActorRef dispatcherActor) {
    return Props.create(HeartBeatActor.class, () -> new HeartBeatActor(masterRouter, dispatcherActor));
}
 
Example #7
Source File: ExecutorActor.java    From Nickle-Scheduler with Apache License 2.0 4 votes vote down vote up
public static Props props(Router masterRouter) {
    return Props.create(ExecutorActor.class, masterRouter);
}
 
Example #8
Source File: ExecutorActor.java    From Nickle-Scheduler with Apache License 2.0 4 votes vote down vote up
public ExecutorActor(Router masterRouter) {
    this.masterRouter = masterRouter;
}
 
Example #9
Source File: ActorFuture.java    From Nickle-Scheduler with Apache License 2.0 2 votes vote down vote up
/**
 * 返回java的future
 *
 * @param router
 * @param msg
 * @param actorContext
 * @return
 */
public static Future<Object> ask(Router router, Object msg, ActorContext actorContext) {
    return THREAD_POOL.submit(new SenderFutureTask(router, msg, actorContext));
}