本文整理匯總了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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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");
}