learning scala akka actorySystem create and close
package com.example import akka.actor.ActorSystem import scala.util.{Failure, Success}
import scala.concurrent.ExecutionContext.Implicits.global
object Tutorial_01_ActorSystem_Introduction extends App {
println("Step1 : Create an actor system")
val system = ActorSystem("DonutStoreActorSystem") println("\nStep 2: close the actor system")
val isTerminated = system.terminate() println("\nStep3: Check the status of the actory system")
isTerminated.onComplete {
case Success(result) => println("Success terminate")
case Failure(e) => println("Failed to terminate");
} Thread.sleep() }
result:
Step1 : Create an actor system Step : close the actor system Step3: Check the status of the actory system
Success terminate
learning scala akka actorySystem create and close的更多相关文章
- learning scala akka ask_pattern
package com.example import akka.actor._ import akka.util.Timeout object Tutorial_03_Ask_Pattern exte ...
- learning scala akka tell pattern(二)
package com.example import akka.actor._ object Tutorial_02_Tell_Pattern extends App { println(" ...
- learning scala How To Create Variable Argument Function - varargs :_ *
Scala collection such as List or Sequence or even an Array to variable argument function using the s ...
- learning scala How To Create Implicit Function
println("Step 1: How to create a wrapper String class which will extend the String type") ...
- 【原创】大叔经验分享(73)scala akka actor
import java.util.concurrent.{ExecutorService, Executors, TimeUnit} import akka.actor.{Actor, ActorSy ...
- scala akka Future 顺序执行 sequential execution
对于 A => B => C 这种 future 之间的操作,akka 默认会自动的按照顺序执行,但对于数据库操作来说,我们希望几个操作顺序执行,就需要使用语法来声明 有两种声明 futu ...
- [lean scala]|How to create a SBT project with Intellij IDEA
this article show you how to create a SBT project with IDEA. prerequisite: 1.JDK8 2.Scala 2.11.8 3.I ...
- [Scala] akka actor编程(一)
Akka基础 Akka笔记之Actor简介 Akka中的Actor遵循Actor模型.你可以把Actor当作是人.这些人不会亲自去和别人交谈.他们只通过邮件来交流. 1. 消息传递 2. 并发 3 ...
- scala akka 修炼之路5(scala特质应用场景分析)
scala中特质定义:包括一些字段,行为(方法/函数/动作)和一些未实现的功能接口的集合,能够方便的实现扩展或混入到已有类或抽象类中. scala中特质(trait)是一个非常实用的特性,在程序设计中 ...
随机推荐
- C复习 (C premier plus和C和指针)
- 微信小程序与Django<一>
小程序开发的准备工作 1. 小程序开发者账号 a) 邮箱注册 b) 开发者配置与AppID c) https://mp.weixin.qq. ...
- HttpClient参观记:.net core 2.2 对HttpClient到底做了神马
.net core 于 10月17日发布了 ASP.NET Core 2.2.0 -preview3,在这个版本中,我看到了一个很让我惊喜的新特性:HTTP Client Performance Im ...
- pandas.to_datetime() 只保留【年-月-日】
Outline pandas.to_datetime() 生成的日期会默认带有 [2019-07-03 00:00:00]的分钟精度:但有时并不需要这些分钟精度: 去掉分钟精度 可以通过pandas ...
- Gitlab 重置 root 密码
要重置root密码,请先使用root权限登录服务器.使用以下命令启动Ruby on Rails控制台: gitlab-rails console production 等到控制台加载完毕,您可以通过搜 ...
- CentOS7-NETWORK,SSH
SSH CentOS会自带SSH,直接启动服务, systemctl start sshd 打开配置文件 vi /etc/ssh/sshd_config 将文件中的下面2行注释去掉 PasswordA ...
- sklearn.model_selection 的train_test_split方法和参数
train_test_split是sklearn中用于划分数据集,即将原始数据集划分成测试集和训练集两部分的函数. from sklearn.model_selection import train_ ...
- SQL进阶系列之10HAVING子句又回来了
写在前面 HAVING子句的处理对象是集合而不是记录 各队,全队点名 --各队,全体点名! CREATE TABLE Teams (member CHAR(12) NOT NULL PRIMARY K ...
- Linux的rwx
- Codeforces B. Too Easy Problems
题目描述: time limit per test 2 seconds memory limit per test 256 megabytes input standard input output ...