akka.actor.Address.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中akka.actor.Address.<init>()方法的一些代码示例,展示了Address.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.<init>()方法的具体详情如下:
包路径:akka.actor.Address
类名称:Address
方法名:<init>

Address.<init>介绍

暂无

代码示例

代码示例来源:origin: keeps/roda

private void processAndAddSeedNode(List<Address> seedNodes, String node) {
 if (StringUtils.isBlank(node)) {
  return;
 }
 try {
  String[] nodeParts = node.split("#", 2);
  seedNodes.add(new Address("akka.tcp", EVENTS_SYSTEM, nodeParts[0], Integer.parseInt(nodeParts[1])));
 } catch (NumberFormatException | IndexOutOfBoundsException e) {
  // do nothing and carry on
 }
}

代码示例来源:origin: saturnism/akka-kubernetes-example

public static void main(String[] args) throws IOException {
  ActorSystem actorSystem = ActorSystem.create(CLUSTER_NAME);
  actorSystem.actorOf(SimpleClusterListener.props());
  final ActorMaterializer materializer = ActorMaterializer.create(actorSystem);

  Cluster cluster = Cluster.get(actorSystem);
  List<Address> addresses = Arrays.asList(System.getenv().get("SEED_NODES").split(","))
    .stream()
    .map(ip -> new Address("akka.tcp", CLUSTER_NAME, ip, 2551))
    .collect(Collectors.toList());
  cluster.joinSeedNodes(addresses);
 }
}

相关文章