当前位置: 首页>>代码示例>>Java>>正文


Java ActorSystem.terminate方法代码示例

本文整理汇总了Java中akka.actor.ActorSystem.terminate方法的典型用法代码示例。如果您正苦于以下问题:Java ActorSystem.terminate方法的具体用法?Java ActorSystem.terminate怎么用?Java ActorSystem.terminate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在akka.actor.ActorSystem的用法示例。


在下文中一共展示了ActorSystem.terminate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import akka.actor.ActorSystem; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    final ActorSystem system = ActorSystem.create("512DB");

    try {
        ActorRef[] KVStores = new ActorRef[num];
        for(int i =0; i < KVStores.length; i++){
            KVStores[i] = system.actorOf(KVStore.props(), "KVStore" + i);
        }
        testQuery(KVStores);
        System.out.println(">>> Press ENTER to exit <<<");
        System.in.read();
    } catch (IOException ioe) {
    	ioe.printStackTrace();
    } finally {
        system.terminate();
    }
}
 
开发者ID:zbd1023,项目名称:512DB,代码行数:18,代码来源:Start.java

示例2: passesOmegaContextAmongActors

import akka.actor.ActorSystem; //导入方法依赖的package包/类
@Test
public void passesOmegaContextAmongActors() throws Exception {
  ActorSystem actorSystem = ActorSystem.create();

  ActorRef actorRef = actorSystem.actorOf(UserServiceActor.props(userService));
  actorRef.tell(user, noSender());

  waitTillSavedUser(username);

  assertArrayEquals(
      new String[] {
          new TxStartedEvent(globalTxId, newLocalTxId, globalTxId, compensationMethod, user).toString(),
          new TxEndedEvent(globalTxId, newLocalTxId, globalTxId, compensationMethod).toString()},
      toArray(messages)
  );

  actorSystem.terminate();
}
 
开发者ID:apache,项目名称:incubator-servicecomb-saga,代码行数:19,代码来源:TransactionInterceptionTest.java

示例3: run1

import akka.actor.ActorSystem; //导入方法依赖的package包/类
private void run1() {
    final ActorSystem actorSystem = ActorSystem.create();
    final Materializer materializer = ActorMaterializer.create(actorSystem);
    final Source<Integer, NotUsed> source = Source.range(0, 10);
    final Flow<Integer, String, NotUsed> flow = Flow.fromFunction((Integer i) -> i.toString());
    final Sink<String, CompletionStage<Done>> sink = Sink.foreach(s -> System.out.println("Example1 - Number: " + s));
    final RunnableGraph runnable = source.via(flow).to(sink);
    runnable.run(materializer);
    actorSystem.terminate();
}
 
开发者ID:henrikengstrom,项目名称:ujug2017,代码行数:11,代码来源:RSExample1.java

示例4: run2

import akka.actor.ActorSystem; //导入方法依赖的package包/类
private void run2() {
    final ActorSystem actorSystem = ActorSystem.create();
    final Materializer materializer = ActorMaterializer.create(actorSystem);
    Source.range(0, 10)
            .map(Object::toString)
            .runForeach(s -> System.out.println("Example 2 - Number: " + s), materializer);
    actorSystem.terminate();
}
 
开发者ID:henrikengstrom,项目名称:ujug2017,代码行数:9,代码来源:RSExample1.java

示例5: testClientDispatcherIsNotGlobalDispatcher

import akka.actor.ActorSystem; //导入方法依赖的package包/类
@Test
public void testClientDispatcherIsNotGlobalDispatcher() {
    ActorSystem actorSystem = ActorSystem.create("with-custom-dispatchers",
            ConfigFactory.load("application-with-custom-dispatchers.conf"));

    ActorContext actorContext = new ActorContext(actorSystem, mock(ActorRef.class), mock(ClusterWrapper.class),
            mock(Configuration.class), DatastoreContext.newBuilder().build(), new PrimaryShardInfoFutureCache());

    assertNotEquals(actorSystem.dispatchers().defaultGlobalDispatcher(), actorContext.getClientDispatcher());

    actorSystem.terminate();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:ActorContextTest.java


注:本文中的akka.actor.ActorSystem.terminate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。