當前位置: 首頁>>代碼示例>>Java>>正文


Java Timeout.apply方法代碼示例

本文整理匯總了Java中akka.util.Timeout.apply方法的典型用法代碼示例。如果您正苦於以下問題:Java Timeout.apply方法的具體用法?Java Timeout.apply怎麽用?Java Timeout.apply使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在akka.util.Timeout的用法示例。


在下文中一共展示了Timeout.apply方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: preStart

import akka.util.Timeout; //導入方法依賴的package包/類
@Override
public final void preStart() throws Exception {
	f = new FutureUtils(getContext(), Timeout.apply(15000));		
	db = new AsyncDatabaseHelper(database, f, log);
	
	doQuery = new HashMap<>();
	doList = new HashMap<>();
	doGet = new HashMap<>();
	doDelete = new HashMap<>();
	doPut = new HashMap<>();
	
	onQuery = new HashMap<>();
	onDeleteBefore = new HashMap<>();
	onDeleteAfter = new HashMap<>();
	onPut = new HashMap<>();
	
	preStartAdmin();
	
	getContext().parent().tell(new Initialized(), getSelf());
}
 
開發者ID:IDgis,項目名稱:geo-publisher,代碼行數:21,代碼來源:AbstractAdmin.java

示例2: S3Restore

import akka.util.Timeout; //導入方法依賴的package包/類
/**
 * Creates a new S3Restore actor. Restoration will start/resume immediately. When restore is complete, the
 * actor will stop.
 * 
 * @param s3 Repository to read from S3
 * @param tag Tag with which all events should be tagged
 * @param shardRegion {@link ReplicatedActorSharding} to talk to
 */
public S3Restore(S3 s3, String tag, ActorRef shardRegion) {
    this.s3 = s3;
    this.tag = tag;
    this.shardRegion = shardRegion;
    
    Config config = context().system().settings().config().getConfig("ts-reaktive.backup.restore");
    maxInFlight = config.getInt("maxInFlight");
    timeout = Timeout.apply(config.getDuration("timeout", TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
    updateAccuracy = FiniteDuration.create(config.getDuration("update-accuracy", TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
}
 
開發者ID:Tradeshift,項目名稱:ts-reaktive,代碼行數:19,代碼來源:S3Restore.java

示例3: setup

import akka.util.Timeout; //導入方法依賴的package包/類
@Before
public void setup() {
	LoggingAdapter log = Logging.getLogger(system, this);
	
	f = new FutureUtils(system, Timeout.apply(1, TimeUnit.SECONDS));
	db = new AsyncDatabaseHelper(database, f, log);
}
 
開發者ID:IDgis,項目名稱:geo-publisher,代碼行數:8,代碼來源:AbstractDatabaseHelperTest.java

示例4: setup

import akka.util.Timeout; //導入方法依賴的package包/類
@Before
public void setup() {
	ActorSystem actorSystem = ActorSystem.create();
	
	recorder = actorSystem.actorOf(Recorder.props(), "recorder");
	database = actorSystem.actorOf(DatabaseMock.props(recorder), "database");
	
	LoggingAdapter log = Logging.getLogger(actorSystem, this);
	
	f = new FutureUtils(actorSystem, Timeout.apply(1, TimeUnit.SECONDS));
	db = new AsyncDatabaseHelper(database, f, log);
}
 
開發者ID:IDgis,項目名稱:geo-publisher,代碼行數:13,代碼來源:AsyncDatabaseHelperTest.java

示例5: preStart

import akka.util.Timeout; //導入方法依賴的package包/類
@Override
public void preStart() throws Exception {
	log.debug("start");
	
	Timeout timeout = Timeout.apply(15000);

	f = new FutureUtils(getContext(), timeout);
	db = new AsyncDatabaseHelper(database, f, log);		
}
 
開發者ID:IDgis,項目名稱:geo-publisher,代碼行數:10,代碼來源:DatasetManager.java

示例6: startServers

import akka.util.Timeout; //導入方法依賴的package包/類
@BeforeClass
public static void startServers() throws Exception {
	h = new GeoServerTestHelper();
	h.start();
	
	Config akkaConfig = ConfigFactory.empty()
		.withValue("akka.loggers", ConfigValueFactory.fromIterable(Arrays.asList("akka.event.slf4j.Slf4jLogger")))
		.withValue("akka.loglevel", ConfigValueFactory.fromAnyRef("DEBUG"));
	
	ActorSystem actorSystem = ActorSystem.create("test", akkaConfig);
	f = new FutureUtils(actorSystem, Timeout.apply(30, TimeUnit.SECONDS));
	service = new DefaultGeoServerRest(f, log, "http://localhost:" + GeoServerTestHelper.JETTY_PORT + "/", "admin", "geoserver");
}
 
開發者ID:IDgis,項目名稱:geo-publisher,代碼行數:14,代碼來源:DefaultGeoServerRestTest.java

示例7: WebSocketDataCenterServer

import akka.util.Timeout; //導入方法依賴的package包/類
public WebSocketDataCenterServer(Config config, ActorRef shardRegion) {
    this.shardRegion = shardRegion;
    this.timeout = Timeout.apply(config.getDuration("timeout", TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
    this.maxInFlight = config.getInt("max-in-flight");
}
 
開發者ID:Tradeshift,項目名稱:ts-reaktive,代碼行數:6,代碼來源:WebSocketDataCenterServer.java


注:本文中的akka.util.Timeout.apply方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。