當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。