本文整理了Java中akka.actor.Address.<init>()
方法的一些代码示例,展示了Address.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.<init>()
方法的具体详情如下:
包路径:akka.actor.Address
类名称: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!