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的更多相关文章

  1. learning scala akka ask_pattern

    package com.example import akka.actor._ import akka.util.Timeout object Tutorial_03_Ask_Pattern exte ...

  2. learning scala akka tell pattern(二)

    package com.example import akka.actor._ object Tutorial_02_Tell_Pattern extends App { println(" ...

  3. 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 ...

  4. learning scala How To Create Implicit Function

    println("Step 1: How to create a wrapper String class which will extend the String type") ...

  5. 【原创】大叔经验分享(73)scala akka actor

    import java.util.concurrent.{ExecutorService, Executors, TimeUnit} import akka.actor.{Actor, ActorSy ...

  6. scala akka Future 顺序执行 sequential execution

    对于 A => B => C 这种 future 之间的操作,akka 默认会自动的按照顺序执行,但对于数据库操作来说,我们希望几个操作顺序执行,就需要使用语法来声明 有两种声明 futu ...

  7. [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 ...

  8. [Scala] akka actor编程(一)

    Akka基础 Akka笔记之Actor简介  Akka中的Actor遵循Actor模型.你可以把Actor当作是人.这些人不会亲自去和别人交谈.他们只通过邮件来交流.  1. 消息传递 2. 并发 3 ...

  9. scala akka 修炼之路5(scala特质应用场景分析)

    scala中特质定义:包括一些字段,行为(方法/函数/动作)和一些未实现的功能接口的集合,能够方便的实现扩展或混入到已有类或抽象类中. scala中特质(trait)是一个非常实用的特性,在程序设计中 ...

随机推荐

  1. pytest_命令行传参

    前言 命令行参数是根据命令行选项将不同的值传递给测试函数,比如平常在cmd执行"pytest --html=report.html",这里面的”--html=report.html ...

  2. kafka学习笔记(二)——基础入门

    1.集群规划 从官网下载jar包 http://kafka.apache.org/downloads.html,我选择的是kafka_2.11-0.11.0.0.tgz版本 规划一下集群环境先~ ha ...

  3. 使用canvas实现360水球波动

    代码如下: <!DOCTYPE html> <html lang="en">  <head>    <meta charset=" ...

  4. Spring AOP 创建Advice 定义pointcut、advisor

    前面定义的advice都是直接植入到代理接口的执行之前和之后,或者在异常发生时,事实上,还可以对植入的时机定义的更细. Pointcut定义了advice的应用时机,在Spring中pointcutA ...

  5. 科普帖:Linux操作系统

    使用计算机必然会接触操作系统,现代操作系统已经发展的十分成熟,一般用户都可以很轻松的使用计算机.然而,对于要利用计算机进行专业开发和应用的用户来说,需要更加深入地理解操作系统的原理和运行机制,这样才能 ...

  6. Jmeter:内存配置 -- 转发

    在压测过程中jmeter报内存溢出,可能的原因有很多.要注意下面三点: 1.单击压测过程中使用过多的线程,官网建议1000-2000.具体看机器的配置和启动应用的情况.(A single JMeter ...

  7. python pip安装解决方法

    一招解决python pip install 安装库失败   PIP是python强大的安装利器,但是我们经常遇到安装库失败的问题,以下本人觉得最有效的解决方法: 1.打开 https://www.l ...

  8. JavaWeb 之 JSON

    一.概述 1.概念 JSON:JavaScript Object Notation  JavaScript对象表示法 2.基本格式 var p = {"name":"张三 ...

  9. java-Ehcache缓存

    springmvc配置文件: <beans .... xmlns:cache="http://www.springframework.org/schema/cache" xs ...

  10. Centos7.3安装nexus-3.14.0-04

    nexus-3.14.0-04的安装       nexus-3.14.0-04-unix.tar.gz             1.下载nexus             2.上传到服务器/root ...