设为首页 加入收藏

TOP

Akka(13): 分布式运算:Cluster-Sharding-运算的集群分片(七)
2017-10-09 13:50:18 】 浏览:6201
Tags:Akka 分布式 运算 Cluster-Sharding- 集群 分片
d.sleep(
1000) val calcRegion = ClusterSharding(shardingSystem).shardRegion(CalculatorShard.shardName) calcRegion ! CalcCommands("1012",Calculator.Num(13.0)) //shard 1, entity 1012 calcRegion ! CalcCommands("1012",Calculator.Add(12.0)) calcRegion ! CalcCommands("1012",Calculator.ShowResult) //shows address too calcRegion ! CalcCommands("1012",Calculator.Disconnect) //disengage cluster calcRegion ! CalcCommands("2012",Calculator.Num(10.0)) //shard 2, entity 2012 calcRegion ! CalcCommands("2012",Calculator.Mul(3.0)) calcRegion ! CalcCommands("2012",Calculator.Div(2.0)) calcRegion ! CalcCommands("2012",Calculator.Div(0.0)) //divide by zero Thread.sleep(15000) calcRegion ! CalcCommands("1012",Calculator.ShowResult) //check if restore result on another node calcRegion ! CalcCommands("2012",Calculator.ShowResult) }

 

 

 

 

 

 

 

 

 

 

首页 上一页 4 5 6 7 下一页 尾页 7/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇scala 基础一 val常量和var变量的.. 下一篇为什么要创建开放源码的PlayScala..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目